Question

I made the mistake of adding a 301 Redirect to my .htaccess file when I didn't want the redirect to be permanent. So, my question is, how can I remove the redirect now? Simply removing the code from the .htaccess file didn't work. I've tried going to the URL on multiple browsers after refreshing the cache multiple times and it still redirects.

I have also tried replacing the 301 redirect with a different URL to see if it would atleast update the page, but that didn't work.

This is the code that was on the .htaccess file before:

Options +FollowSymLinks
RewriteEngine On
RewriteRule ^redirectURL.*$ http://www.website.com/ [R=301,L]

This is what I've tried to change it to:

Options +FollowSymlinks -MultiViews
RewriteEngine On
RewriteRule ^differentRedirect/? http://www.othersite.com/ [R=302,NC,L]

Is something wrong with the syntax or is the real problem that I used a permanent redirect?

After doing a curl -I on the site I get the following:

HTTP/1.1 301 Moved Permanently
Server: nginx
Date: Tue, 06 May 2014 03:13:12 GMT
Content-Type: text/html; charset=iso-8859-1
Content-Length: 343
Connection: keep-alive
Keep-Alive: timeout=15
Location: http://www.website.com
Cache-Control: max-age=86400
Expires: Wed, 07 May 2014 03:13:12 GMT
Vary: Accept-Encoding

Does that mean after Wednesday, 7 May it will no longer redirect???

Was it helpful?

Solution

So... funny story....

Apparently my web host just barely decided to migrate all of my content to a new server. I didn't realize this and so I was editing the .htaccess file from the old server. Once I changed the .htaccess file on the new server, everything worked great.

So, one thing that can be learned from this is, even if you do have NGINX, the .htaccess file is still vital and can still be used for server configuration.

I also decided to use the easier syntax below for my now TEMPORARY redirect:

Redirect 302 /page http://www.example.com/
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top