Copy link to clipboard
Copied
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!
Copy link to clipboard
Copied
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]
Copy link to clipboard
Copied
Is mod_rewrite something that needs to be enabled on the server? (not too familiar with)
Thank you.
Copy link to clipboard
Copied
Yes, I'm assuming your on an apache web server? Please give more details about your hosting platform, are you on shared hosting?
Copy link to clipboard
Copied
Assuming you are on an apache web server, in apache configuration file (httpd.conf) look for this:
#LoadModule rewrite_module modules/mod_rewrite.so
remove the hash at the start to enable the mod_rewrite module:
LoadModule rewrite_module modules/mod_rewrite.so
then restart apache...
Typically the the apache config file it at one of these locations:
- /etc/apache2/httpd.conf
- /etc/apache2/apache2.conf
- /etc/httpd/httpd.conf
- /etc/httpd/conf/httpd.conf
Copy link to clipboard
Copied
Looks like it's .net... so need web.config.
I have found different info online so do not know how to format correctly and which will work!
Here is one source I found: Any change you can plug in an example here of how it might look with a mock URL redirecting to another mock URL? I am confused by this caret character and abc.html. Ideally, I need to show redirects for two separate pages that will redirect to the homepage of a site.
<system.webServer>
<rewrite>
<rules>
<rule name="URL1" stopProcessing="true">
<match url="^abc.html" ignoreCase="true" />
<action type="Redirect" url="Your current page path" redirectType="Permanent" />
</rule>
</rules>
</rewrite>
</system.webServer>
Copy link to clipboard
Copied
Ask your web host to help you. Often this can be managed from your Plesk-panel.
Copy link to clipboard
Copied
your on an IIS server by the looks of it HTTP Redirects <httpRedirect> | Microsoft Docs
Copy link to clipboard
Copied
who's your web host ?