【发布时间】:2011-01-28 17:49:28
【问题描述】:
我发现了一些关于 url 重写的问题: .htaccess: Problem with URL rewriting 或 .htaccess question - URL-rewriting
我尝试了他们的方法,但在我的情况下不起作用? 我的看起来很简单:
http://example.org.uk/member/home.php?profile --> http://example.org.uk/member/home/profile/
http://example.org.uk/member/home.php?history --> http://example.org.uk/member/home/history/
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule ^home/([0-9][0-9])/$ /home.php?$1
RewriteRule ^/([^/]+).php$ /home.php?$1 [L]
有什么想法吗?谢谢
【问题讨论】:
-
您的规则和示例相互矛盾。您希望将
home.php?profile映射到home/profile(示例)还是将home/profile重写为home.php?profile(重写代码)? -
@Linus:我想映射到主页/配置文件并删除 php ex。
标签: php .htaccess url-rewriting