【发布时间】:2016-03-14 06:07:02
【问题描述】:
我正在使用以下 htaccess 代码。
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]
RewriteRule ^Profile/([0-9]+)/?$ ViewProfile.php?id=$1 [NC,L]
这是网址 http://localhost/ConnectMyProfile/ViewProfile.php?id=CMP26944
我需要将此网址转换为http://localhost/ConnectMyProfile/ViewProfile/CMP26944
为此,我使用了此代码 (RewriteRule ^Profile/([0-9]+)/?$ ViewProfile.php?id=$1 [NC,L])。
它不起作用。请帮我解决这个问题。
【问题讨论】:
标签: php