Skip to main content
Inspiring
August 6, 2019
Question

htaccess & 301 redirect

  • August 6, 2019
  • 2 replies
  • 1523 views

Example of code in the .htaccess file below. Not sure why it is not working. Should those old files be purged from the server, or does it not matter? I did purge one of them during my testing, but did not make a difference. I get the Server Error 404 page. I even tried making the first call of the 'old' URL absolute. No luck! I just want these old pages to redirect to the homepage.

Redirect 301 /summer_autumn/index.htm http://www.url.com

Redirect 301 /activity_groups/index.htm http://www.url.com

Would appreciate any suggestions. Thank you!

    This topic has been closed for replies.

    2 replies

    Legend
    August 9, 2019

    who's your web host ?

    Paul-M - Community Expert
    Legend
    August 6, 2019

    That looks ok to me - maybe some other issue - have you checked with your web host?

    Alternative approach if you have mod_rewrite enabled:

    RewriteCond %{REQUEST_URI} ^/summer_autumn/index.htm [OR]

    RewriteCond %{REQUEST_URI} ^/activity_groups/index.htm

    RewriteRule (.*) http://www.url.com/? [L,R=301]

    Paul-M - Community Expert
    r_tistAuthor
    Inspiring
    August 6, 2019

    Is mod_rewrite something that needs to be enabled on the server? (not too familiar with)

    Thank you.

    Legend
    August 6, 2019

    Yes, I'm assuming your on an apache web server? Please give more details about your hosting platform, are you on shared hosting?

    Paul-M - Community Expert