.htaccess重定向到原始URL

时间:2014-11-20 06:01:08

标签: php apache .htaccess mod-rewrite

我有以下.htaccess文件,我正在尝试重写网址 www.example.com/play/tribe-test ,而不是 www.example.com/love/tribe-world /部落测试

现在,当我点击 www.example.com/play/tribe-test 时,它会将我重定向到 www.example / love / tribe-world / tribe-test 这是原始网址。

RewriteEngine on
RewriteRule ^play/(tribe-test.*)$ /love/tribe-world/$1 [L] // This rule is getting redirected to original URL

RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(we-are-stereotribes.*)$ /love/tribe-world/$1 [L,QSA]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(for-the-lovers.*)$ /love/tribe-world/$1 [L,QSA]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(for-the-campaigners.*)$ /love/tribe-world/$1 [L,QSA]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(for-the-funders.*)$ /love/tribe-world/$1 [L,QSA]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(terms-of-use.*)$ /love/tribe-world/$1 [L,QSA]
RewriteRule ^(privacy-policy.*)$ /love/tribe-world/our-support/$1 [L,QSA]

# prevent httpd from serving dotfiles (.htaccess, .svn, .git, etc.)
RedirectMatch 403 /\..*$
# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#RewriteCond %{REQUEST_URI}  !(\.png|\.jpg|\.gif|\.jpeg|\.bmp|\.css|\.js)$
#RewriteRule ^theme/anther/?  sthemes/anther/index.html 
RewriteRule !html|\.(pdf|php|js|ico|txt|gif|swf|jpg|png|css|rss|zip|tar\.gz)$ index.php

非常感谢您的帮助

提前致谢

0 个答案:

没有答案