【发布时间】:2016-07-22 22:24:57
【问题描述】:
我的网址是这样的:
http://example.com/Folder/index.php?city=Berlin&id=1
我想把它变成:
http://example.com/Berlin/1
使用Generate It! 我得到这个代码:
RewriteEngine On
RewriteRule ^([^/]*)/([^/]*)$ /Folder/index.php?city=$1&id=$2 [L]
但是在我的 .htaccess 文件中添加它并尝试打开 http://example.com/Berlin/1 时,我收到以下错误:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, [no address given] and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Apache/2.2.14 (Ubuntu) Server at example.com Port 80
我做错了什么?我从 几个小时 开始尝试让它工作,但没有成功。
【问题讨论】:
-
重写规则 ^(.*)/(.*)$ /Folder/index.php?city=$1&id=$2 [L]
-
不工作,仍然出现同样的错误。
标签: php apache .htaccess mod-rewrite internal-server-error