htaccess URL子目录的重定向?

时间:2014-03-10 12:47:32

标签: .htaccess url-rewriting

我正在为我的网站

创建一个子目录
www.example.com/me/index.php

和我正在工作的另一个页面是

www.example.com/me/showme.php?post=i-am-from-india

这将显示完整的帖子,但我希望它像这样

www.example.com/me/showme/i-am-from-india

我找到并引用了Here,但它在我的情况下不起作用。

请帮助我。

1 个答案:

答案 0 :(得分:0)

内部/.htaccess有此规则:

RewriteEngine On
RewriteBase /

RewriteCond %{THE_REQUEST} /me/ [NC]
RewriteRule ^me(/.*)?$ /$1 [L,R=301,NC,NE]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ /me/showme.php?post=$1 [L,QSA]
相关问题