1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.4 Redirect old urls

Discussion in 'Troubleshooting and Problems' started by asusforo, May 17, 2015.

  1. asusforo

    asusforo Member

    2 years ago i used Vbulletin, with a photogallery. Users posted images in their text with those image urls, like


    Now we are using Xenforo, and we deleted all images of Vbulletin (accidentally) but Google webmaster tools is giving crawl errors of not found urls. More than 400 errors, and they are all from these attachments. How can i solve this problem? Its impossible to edit hunderds posts to delete the image url. So i thought about redirecting all /attachments/ urls to my homepage (htaccess).

    How can i do this? And What is your opinion?

    I appreciate your support.
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Well, a "not found" error is appropriate if the content no longer exists.

    If you want to redirect those links to your homepage then add these rules to the top of the .htaccess file in your web root:

    RewriteEngine On
    RewriteRule ^attachments/[0-9]+/$ /? [R=301,L]

Share This Page