带有.htaccess的语义URL(错误500)


Semantic URL with .htaccess (Error 500)

我想用语义表示我的网站URL,但当我想显示结果时,我有一个500错误的

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator at admin@example.com to inform them of the time this error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.
Apache/2.4.9 (Win32) PHP/5.5.12 Server at localhost Port 80

.htaccess代码

RewriteEngine on
RewriteCond %{REQUEST_URI} 10/
RewriteRule 10/ http://localhost/Cnxkhamsat/admin/edit.php?chi_id=10

有什么帮助吗?

在本地机器上尝试时,代码似乎工作正常,这意味着没有语法错误。

最有可能的情况是您没有使用RewriteEngine的适当权限。这通常发生在使用共享主机或有时使用VPS时。

如果您有权访问httpd.conf文件,您很可能会从那里打开"重写引擎"。如果你无法访问它,那么你可能需要联系你的托管提供商,告诉他们你需要他们来允许你使用重写引擎。