How can I redirect old URLs to new ones?
-
We are trying to optimize our website for search engines and one of the things we have noticed that needs to be changed are the URLs. I know how to modify the URLs but have no idea how I can get the old redirected to the new ones using 301. We have some pages ranking pretty high on Google and we can't loose this traffic.
Our website is hosted on Plesk and it was coded using Cold Fusion. I do have access to the .htaccess file.
Any help would be highly appreciated.
-
Don't forget to escape your hyphens (all of them!) with backslashes:
^pvc-cosmetic-bag-1.html
You will need to escape them before white too:
---white
-
As this URL in particular had a .html extension I thought it was easier to just create a html file and redirect it, so this one is working. But I still would like to know if i had done anything wrong because it didn't work. As most of our URLs don't have a .html extension it would be helpful to create the redirects on .htaccess
-
I just created a .html file for one of the URLs that had this extension thought the system doesn't generate htmls and it worked! Now I need to find a solution to the URLs that don't have an extension...
-
Hi, thanks for your help. The problem with this is that I don't have access to individual pages, the system will load it from the database. I think a .htaccess redirect would be the best solution, the problem is that I don't really know how to do it and how to write a redirect that would work.
Best regards
-
I have tried it but still no luck, I might have done something wrong though.
I need to urgently redirect http://www.personal-products.co.uk/pvc-cosmetic-bag-1.html to http://personal-products.co.uk/resealable-cosmetic-bags---white (I will change this URL in the future too but need it working now...)
I have tried it like this:
RewriteRule ^pvc-cosmetic-bag-1.html /resealable-cosmetic-bags---white [R=301,L]
Is there anything wrong?
Thanks!
-
Hi
maybe this article can help: http://www.quackit.com/coldfusion/tutorial/coldfusion_redirect.cfm
In ColdFusion, redirects can be done via one of two methods. The method you use will depend on the reason for the redirect.
Temporary Redirects (cflocation)
This is the most commonly used of the two - you will probably find yourself using the cflocation tag often.
A temporary redirect is typically used when you need to redirect the user to another page based on some logical rule in your program. For example, straight after they submit a form, the browser might redirect to another page.
ColdFusion includes the cflocation tag for performing temporary redirects. This actually sends HTTP headers to the user's browser indicating a 302 status code, which means "Moved Temporarily".
<cflocation url="/new_location.cfm"></cflocation>
Permanent Redirects
A permanent redirect should be used when a page no longer exists.
Permanent redirects use the 301 HTTP status code, which means, "Moved Permanently". In ColdFusion, a permanent redirect can be achieved using the cfheader tag.
<cfheader statuscode="301" statustext="Moved Permanently"><cfheader name="Location" value="http://www.quackit.com/coldfusion/tutorial"><cfabort></cfabort></cfheader></cfheader>
In case you're thinking, "but users can't see the status code anyway", that's only partially true. The 301 status code can be very useful for search engines. They will actually take notice of your 301 status code and index the correct file.
-
You could try something like this:
RewriteRule ^overnight-toiletry-packs.html /toiletry-travel-bags [R=301,L]
You need to escape the hyphens and periods... and include the switches for the 301 and specify that it's the Last rule.
Let me know how that goes - certainly share some code if you still get stuck.
-John
-
Thanks for your help!
The example would be the same as the one above, do you know what is the best way to do it??
http://personal-products.co.uk/overnight-toiletry-packs.html -> our current url
we have optimized this page to "toiletry travel bags" so i want the url to look something like this:
-
Thanks.. I got that far, but I tried few different 301 redirects and it didn't work.
One example would be this:
http://personal-products.co.uk/overnight-toiletry-packs.html -> our current url
we have optimized this page to "toiletry travel bags" so i want the url to look something like this:
http://personal-products.co.uk/toiletry-travel-bags
I can change the URL manually but I need to create a 301 redirect. Do you have any idea how I can do it? As we use a coldfusion website, the pages don't actually exist, they are all on the database.
i had tried few methods I found on google but no luck =[
-
Hey Flavia-
Check out this article on htaccess magic
http://www.askapache.com/htaccess/list-of-methods-to-redirect-users-to-different-page.html
There is a section on 301 redirects that will get you started. If you want to share any specific examples I'd be happy to help you further.
-John
-
You can do 301 redirects from the old page to the new page using .htaccess..however I would suggest you test the impact by doing it for 1-2 urls first and see if it does indeed help. The reason I am suggesting this is because when you do 301 redirects or canonical urls which also act like 301s, there's a little bit of link juice loss from the old URL. S if you have lots of websites linking to that page, you may loose a little bit of that link juice. Again, you have to do more of a risk/reward analysis and see what makes sense.
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
What to do with old content after 301 redirect
I'm going through all our blog and FAQ pages to see which ones are performing well and which ones are competing with one another. Basically doing an SEO content clean up. Is there any SEO benefit to keeping the page published vs trashing it after you apply a 301 redirect to a better performing page?
Technical SEO | | LindsayE0 -
Is it a good idea to use an old domain name for a new product
Hi guys, I have a domain name XYZ.com which hosts the site of a technology service company as of now. The company however didn't do well and shut down a few years ago. Now, that company wants to launch a new set of technology products and wants to use the same domain name. Is it a good idea. The issues that I can see here are: 1. Google has previous pages indexed 2. There are a couple of subdomains totally irrelevant to the business. like employees.xyz.com there. 3. Can the previous indexing be completely undone. Regards, Mayank
Technical SEO | | mayanksaxena0 -
41.000 pages indexed two years after it was redirected to a new domain
Hi!Two years ago, we changed the domain elmundodportivo.es to mundodeportivo.com. Apparently, everything was OK, but more than two years later, there are still 41.000 pages indexed in Google (https://www.google.com/search?q=site%3Aelmundodeportivo.es) even though all the domains have been redirected with a 301 redirect. I detected some problems with redirections that were 303 instead of 301, but we fixed that one month ago.A secondary problem is that the pagerank for elmundodportivo.es is 7 yet and mundodeportivo.com is 3.What I'm doing wrong?Thank you all,Oriol
Technical SEO | | MundoDeportivo0 -
Updating content on URL or new URL
High Mozzers, We are an event organisation. Every year we produce like 350 events. All the events are on our website. A lot of these events are held every year. So i have an URL like www.domainname.nl/eventname So what would you do. This URL has some inbound links, some social mentions and so on. SO if the event will be held again in 2013. Would it be better to update the content on this URL or create a new one. I would keep this URL and update it because of the linkvalue and it is allready indexed and ranking for the desired keyword for that event. Cheers, Ruud
Technical SEO | | RuudHeijnen0 -
Best way to redirect 3 sites to 1 new one.
Hi All We currently have 3 old sites that have tones of content. Due to brand/business consolidation we have merge all 3 to produce 1 website. The new site contains all the old content from the old 3. So, I know I need to 301 redirect all the old content from the previous sites to the equivelent content on the new sites but am confused how you do this with 3 domains? One of the domains is being replaced with the new site. So I have: www.domain1.co.uk www.domain2.co.uk www.domain3.co.uk All the content for all the sites have been imported into a new site and any duplicate content issues havce been resolved. Can anyone point me in the right direction? Thanks
Technical SEO | | EclipseLegal0 -
How can i redirect a url that has % in it?
Google webmaster tools shows a 400 eroor for an old link that contains a 30% off in it. The problem is the % I would like to 301 redirect this link : http://www.geographics.com/Graduation-Stationery,-35%-OFF-Printable-Certificates-Blank-Gift-Certificates/c1353_1354_1359/index.html to http://www.geographics.com/Graduation-Stationery-Printable-Certificates-Blank-Gift-Certificates/c1353_1354_1359/index.html We do not know how to do this in httaccess. Can you please advise? Thanks a lot! Madlena
Technical SEO | | Madlena0 -
Link Juice passing through a redirect of a disallowed URL
Hey guys! Suppose I disallow search bots from indexing anything on my secure server in my robots.txt, and 301 redirect all of my secure server traffic to my non-secure site. Will the search bots see the redirect before they realize that they're disallowed from accessing that page? Or will they see that page is disallowed and not follow the redirect? Should I change my robots.txt to allow search bots to crawl my secure site so they can find the redirects?
Technical SEO | | john4math0