【发布时间】:2013-08-01 09:27:45
【问题描述】:
运行一个 wordpress 站点,因此它已经有自己的规则从链接中删除 index.php。此外,每次在 url 中有“cache_img”时,都会应用一个特定的规则。
我需要什么:
- 让当前规则继续有效
- 如果网址是 https,则用 http (301) 重写,除了 3 页(bookingstep1、bookingstep2、bookingsep3)
我很讨厌 htaccess,这对我来说几乎没有意义,我希望有人可以帮助我。我对 htaccess 或 php 解决方案持开放态度。
这是我目前所拥有的(它可能已经有错误......)
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/(cache_img) [NC]
RewriteRule . /index.php [L]
RewriteRule ^cache_img/(.*)x(.*)-(.*)/r/(.*) cache_img/tt.php?src=http://mydomain.com/$4&w=$1&h=$2&zc=$3&q=100
我尝试在我的 htaccess 顶部添加:
RewriteCond %{HTTPS} on
Rewritecond %{REQUEST_URI} !^bookingstep(1|2|3)\/?$ [NC]
RewriteRule ^(.*) http://mydomain.com/$1 [R=301,L]
这适用于所有页面...它删除了 https 并用 http 重写它们。 但它也重写了 bookinstep* 页面:(
请帮忙!谢谢!
【问题讨论】:
标签: wordpress .htaccess http redirect https