Forum Moderators: phranque
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} ^mysite\.com$ [NC]
RewriteRule ^(.*)$ http://www.mysite.com/$1 [R=301,L]
Redirect 301 /redirect/forecast.weather.gov/mapclick.shtml http://www.nws.noaa.gov/view/largemap.php
RewriteEngine On
RewriteRule ^redirect/forecast\.weather\.gov/mapclick\.shtml http://www.nws.noaa.gov/view/largemap.php [R=301,L]
RewriteCond %{HTTP_HOST} !^(www\.example\.com)?$
RewriteRule (.*) http://www.example.com/$1 [R=301,L] What if i have multiple different links to redirect when each relevant link is clicked on?
Redirect 301 /redirect/forecast.weather.gov/mapclick.shtml http://www.nws.noaa.gov/view/largemap.php
When you click the link on my website, the following message appears even though this link is on my server, not sure what is wrong?
Not Found
The requested URL /redirect/forecast.weather.gov/mapclick.shtml was not found on this server.
[edited by: phranque at 6:48 am (utc) on Feb 24, 2014]
[edit reason] Please Use example.com [webmasterworld.com] [/edit]
RewriteCond %{HTTP_HOST} !^(www\.example\.com)?$
RewriteRule (.*) http://www.example.com/$1 [R=301,L]