簡體   English   中英

基本URL重寫導致內部服務器錯誤

[英]Basic URL Rewriting causing internal server error

我對此很陌生,已經閱讀了幾篇有關URL重寫的文章。

http://www.addedbytes.com/articles/for-beginners/url-rewriting-for-beginners/

http://coding.smashingmagazine.com/2011/11/02/introduction-to-url-rewriting/

我要做的就是更改www.domain.com/single-recipe.php?id=6

前往www.domain.com/recipes/6

從教程中,我在.htaccess中提出了以下代碼

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www.domain.com [NC]
RewriteRule ^(.*)$ http://domain.com/$1 [L,R=301]

RewriteRule    ^recipes/([0-9]+)/?$    single-recipe.php?id=$1    [NC,L]    # Handle recipe requests

當我嘗試訪問網站上的任何頁面時,都會看到一個可愛的內部服務器錯誤500。

任何幫助,將不勝感激。

我認為是因為有多余的空間,請刪除並嘗試:

RewriteRule ^recipes/([0-9]+)/?$ single-recipe.php?id=$1[NC,L]

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM