重定向到主页htaccess问题

时间:2015-07-08 07:02:57

标签: .htaccess

我有一个奇怪的问题,页面正在重定向到主页。让我解释一下 - 我的网站是thedj.com.au

现在当我输入www.thedj.com.au/payments时,它会重定向到thedj.com.au(即使它应该转到页面https://thedj.com.au/payments)。

知道这是为什么以及如何解决?

我的htaccess文件如下:

# BEGIN HTTPS Redirection Plugin
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^home.htm$ https://thedj.com.au/ [R=301,L]
RewriteRule ^photos.htm$ http://photos.thedj.com.au/ [R=301,L]
RewriteRule ^contacts.htm$ https://thedj.com.au/contact-us/ [R=301,L]
RewriteRule ^booking.htm$ https://thedj.com.au/book-dj/ [R=301,L]
RewriteRule ^downloads.htm$ https://thedj.com.au/downloads/ [R=301,L]
RewriteRule ^payonline.htm$ https://thedj.com.au/payments/ [R=301,L]
RewriteRule ^price.htm$ https://thedj.com.au/pricing/ [R=301,L]
RewriteRule ^questions.htm$ https://thedj.com.au/faq/ [R=301,L]
RewriteRule ^links.htm$ https://thedj.com.au/links/ [R=301,L]
RewriteRule ^thankyous/index.htm$ https://thedj.com.au/testimonials/ [R=301,L]
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://thedj.com.au/ [L,R=301]
</IfModule>
# END HTTPS Redirection Plugin

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

RewriteCond %{HTTP_HOST} ^mrdj\.net\.au$ [OR]
RewriteCond %{HTTP_HOST} ^www\.mrdj\.net\.au$
RewriteRule ^/?$ "https\:\/\/thedj\.com\.au\/" [R=301,L]

RewriteCond %{HTTP_HOST} ^mrdj\.com\.au$ [OR]
RewriteCond %{HTTP_HOST} ^www\.mrdj\.com\.au$
RewriteRule ^/?$ "https\:\/\/thedj\.com\.au\/" [R=301,L]

RewriteCond %{HTTP_HOST} ^thedjs\.com\.au$ [OR]
RewriteCond %{HTTP_HOST} ^www\.thedjs\.com\.au$
RewriteRule ^/?$ "https\:\/\/thedj\.com\.au\/" [R=301,L]

RewriteCond %{HTTP_HOST} ^theperthweddingdjs\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.theperthweddingdjs\.com$
RewriteRule ^/?$ "https\:\/\/thedj\.com\.au\/" [R=301,L]

RewriteCond %{HTTP_HOST} ^thedjs\.net\.au$ [OR]
RewriteCond %{HTTP_HOST} ^www\.thedjs\.net\.au$
RewriteRule ^/?$ "https\:\/\/thedj\.com\.au" [R=301,L]

注意: 我试过评论一下

#RewriteCond %{HTTPS} off
#RewriteRule ^(.*)$ https://thedj.com.au/ [L,R=301]

然而,这并未解决问题。我认为这可能是因为该网站完全是https:// - 但是我们非常感谢您提供更多的想法。

最佳, 科斯塔

1 个答案:

答案 0 :(得分:0)

.htaccess不应该在这里进行任何重定向。 对于测试,this website可能很有用。

此配置是否来自您的实际网站?因为https://thedj.com.au/payments适合我。 浏览器倾向于非常积极地缓存永久重定向。您需要清除整个缓存或使用隐私浏览模式再次测试重定向。 (但您需要关闭所有私人浏览窗口,然后打开一个新窗口)

相关问题