|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Muliple 301 redirects
Hi, I am about to launch a new site and want to 301 redirect all the old URLs to the new site URLs. Is there an easy and best way to this in one file or do I need to create seperate files for each old page? Or can it be done at the server side?
|
|
#2
|
||||
|
||||
|
Quote:
As people found out a while back im not that great with .htaccess etc... But if i had to do this i would create a page (php or asp depending on your file extensions) and i would make it 301 redirect to [newurldomain].com/[getpageurl].asp. If included on all pages this would suffice as it would pull the current page name and then just redirect to the new domain, adding the page name in. |
|
#3
|
||||
|
||||
|
Quote:
Considering you are keeping the folder and file structure/ name same in the new site, you can use this code in the htaccess of your old domain: Options +FollowSymLinks RewriteEngine on RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L] This will redirect every page of the old URL to its corresponding new page in the new domain.
__________________
SEO FAQs - You might find your answer here. SEOchat Forum Rules - Read Before You Post **Do what you feel in your heart to be right- for you'll be criticized anyway. You'll be damned if you do, and damned if you don't.** |
|
#4
|
||||
|
||||
|
I got a bit confused!You said its a new site but you want to redirect the old url? How is that happen?
__________________
|
|
#5
|
||||
|
||||
|
Quote:
Simple! Old site http://www.abc.com/flowers/roses.html New Site http://www.xyz.com/flowers/roses.html He wants to redirect the old URL to the new one. |
|
#6
|
|||
|
|||
|
How many URLs and what kind of hosting?
My preferred way is to setup a RewriteMap text file with old and corresponding new addresses in. This means you don't swamp your .htaccess file with hundreds of redirects, but you need to have a host/server capable of adding it to their apache configuration file Could then sit a file e.g. redirects.txt and it would look like Code:
old.html new.html testing/old-html.asp test/new.asp And if done correctly do redirects for all the files Bit of a headache to set up but works really well once it's done |
|
#7
|
|||
|
|||
|
I have about 2000 pages but really only about 150 with any worthwhile PR and optimised well. We are going from .asp to .aspx on a windows server.
Thanks for all you help |
|
#8
|
|||
|
|||
|
I don't code aspx (code php) but know from experience there's a function something like 'applicationBeginRequest'
You can put a switch / select statement in here exploding / analysing the URL and perform redirects on 150 addresses no problem |
|
#9
|
||||
|
||||
|
Quote:
Ok. so a normal asp 301 is the following: Code:
<% ' Permanent redirection Response.Status = "301 Moved Permanently" Response.AddHeader "Location", "/blue-widget.asp" Response.End %> All you would need to do is have it get the current filename, redirect to the new domain and add an "x" on to the end so it would go from: http://xyz.com/blue-widget.asp and will then be http://abc.com/blue-widget.aspx This should work if included on every page (the code needs to be ammended obv. but if you are reverting to aspx you should know how to do it, or should have an IT guy who does). |
![]() |
| Viewing: SEO Chat Forums > Google > Google Optimization > Muliple 301 redirects |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|