Cannot remove 301 redirect

后端 未结 6 919
滥情空心
滥情空心 2020-12-16 13:59

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 n

相关标签:
6条回答
  • 2020-12-16 14:31

    Just delete the line about the Redirect.

    And also everyone who has Google Chrome, do the following steps:

    1. Press CTRL + SHIFT + SUPR from your keyboard.
    2. Only check -> "Files and images stored in cache"
    3. Select in "Elements stored in cache since: Past week"

    That will clear all your cache and you'll be fine.

    0 讨论(0)
  • 2020-12-16 14:37

    The permanent redirect cache is probably in the browser
    and in most browsers it is tricky to remove it.
    But first, try using a different browser to see if this is the case.

    In case the problem is in the browser:
    This happened to me before and cleaning the browser data for that website was not enough.
    I also realized that there is a trick for each browser.
    In Safari (for Mac), I needed to select "Reset Safari..." (No panic, with this option neither bookmarks neither extensions are deleted).
    I cannot recall how I did it for Chrome but was less traumatic.

    The lesson
    When playing with redirects use [302] first.
    After everything was tested ok, change the code to [301]

    0 讨论(0)
  • 2020-12-16 14:37

    Try giving Apache a restart

    (on Ubuntu servers: service apache restart or /etc/init.d/apache2 restart)

    0 讨论(0)
  • 2020-12-16 14:40

    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
    0 讨论(0)
  • 2020-12-16 14:46

    With Chrome, try to visit the website with Developers Console open (F12)

    Make sure you have "Disable cache" checked under "Network" tab

    This will bypass 301 redirect cache on browser-side.

    0 讨论(0)
  • 2020-12-16 14:51

    I know this is an old post but i spent some time on the Web and my server to find the answer.

    If you created an .htaccess file with a permanent redirection, the server will copy this redirection in the following file : "/var/.htaccess".

    You have to edit this file to remove the redirection before cleaning the cache of your browser.

    It worked on my Debian Jessie.

    0 讨论(0)
提交回复
热议问题