How to redirect every page on server
Posted by: ankaj (---.micron.com)
Date: November 07, 2011 07:18PM

Hi,
I recently moved my server from one location to another, both physical location and the url changed, I am wondering how I can setup a redirect that runs for every page on the old server/url. I have set up a redirect for the home page, but would like to not have to edit the 100+ pages by hand to add a redirect to the home page on the new server. The reason I need to have this functionality, is in case any users have bookmarks to pages on the old server.

Thanks for your help.
~ankaj

Options: ReplyQuote
Re: How to redirect every page on server
Posted by: yfastud (Moderator)
Date: November 08, 2011 01:09AM

Use htaccess w/ mod rewrite; for example, want to move your entire website from 'http://yourdomain1.com' to 'http://yourdomain2.com', create htaccess file with the code below and put it in the root of 'http://yourdomain1.com'
Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) [yourdomain2.com] [R=301,L]

Note: This forums is auto rewrite the URL so you only see 'yourdomain2.com' instead the correct is 'http://yourdomain2.com/$1'

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Options: ReplyQuote


Sorry, only registered users may post in this forum.