我目前的网址是
http://localhost/www.zeeshan.com/user.php?name=zeeshan06
我想将我的网址显示为
http://localhost/www.zeeshan.com/user/zeeshan06
我使用以下代码但不起作用
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
Options +FollowSymlinks
RewriteBase /
RewriteRule ^user/(.*)user.php?name=$1 [R]
请帮我解决我的问题。感谢。
答案 0 :(得分:2)
如果您将此.htaccess
放入文件夹www.zeeshan.com
:
Options +FollowSymLinks -MultiViews
RewriteEngine On
RewriteBase /www.zeeshan.com/
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^user/([^/]+)$ user.php?name=$1 [NC,L]
访问网址:
http://localhost/www.zeeshan.com/user/zeeshan06
它应该引导你:
http://localhost/www.zeeshan.com/user.php?name=zeeshan06