Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
424 views
in Technique[技术] by (71.8m points)

.htaccess - Cannot remove 301 redirect

I stupidly did a 301 redirect on websiteA.com to websiteB.com. After removing it from the .htaccess file the redirect is still in operation. I tried from outside the local network and it is still redirecting. I have cleared my cache and tried a different browser.

Does anybody have any suggestions?

UPDATE:

If I add a 302 redirect to this .htaccess file the site honours it. When I remove it, the old 301 redirect still happens.

.htaccess file for websiteA.com:

# -- concrete5 urls start --

Options -Indexes

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
# -- concrete5 urls end --

#RewriteCond %{HTTP_HOST} ^.*$
#RewriteRule ^/?$ "http://www.websiteB.co.uk/" [R=301,L]
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

The browser caches the 301 Moved Permanently, until told otherwise. It is default behavior: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.2.

To fix it in IE9:

  1. Open IE9 and press Ctrl+Shift+P for private browsing
  2. Navigate to the problem URL
  3. Then go back to normal browsing and all should be fine again

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...