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
-
SEO URLs: 1\. URLs in my language (Greek, Greeklish or English)? 2\. Αt the end it is good to put -> .html? What is the best way to get great ranking?
Hello all, I must put URLs in my language Greek, Greeklish or in English? And at the end of url it is good to put -> .html? For exampe www.test.com/test/test-test.html ? What is the best way to get great ranking? I am a new digital marketing manager and its my first time who works with a programmer who doesn't know. I need to know as soon as possible, because they want to be "on air" tomorrow! Thank you very much for your help! Regards, Marios
Technical SEO | | marioskal0 -
How to redirect old domain to new domain.
We just recently signed up to Moz with hopes of fixing our Moz Ranking. We have an old domain - http://at-net.net and a new domain - https://www.expertip.net We have set up 301 (Permanent) redirects from all pages on the old site to the new, but aren't getting the ranking or aren't getting recognized from external links to the old sites. I've read the moz article on 'Link Juice' and followed those practices, but it doesn't seem to help. Does anyone have advice on doing this? Thanks in advance,
Technical SEO | | greg.lanier
Greg0 -
I have a sub domain that has live content on it but the root domain redirects to another URL. I know this is not great but what are the implications?
I have a subdomain that is populated and has content. The root domain that the sub lives on redirects to an entirely different URL. I am trying to make a case as to why this isn't great besides the fact that it is just weird user experiences. What are the SEO implications etc. Would any equity that gets built up on the subdomain get passed along in the redirect? Or will there be indexation issues with Google? Cheers, Mark
Technical SEO | | mjsikorsky0 -
What is the best practice to seperate different locations and languages in an URL? At the moment the URL is www.abc.com/ch/de. Is there a better way to structure the URL from an SEO perspective?
I am looking for a solution for using a new URL structure without using www.abc.com**/ch/de** in the URL to deliver the right languages in specific countries where more than one language are spoken commonly. I am looking forward to your ideas!
Technical SEO | | eviom0 -
What is URL Enforce Writer & How it can be write.
Hi, What is URL enforce writer to write existing web page URL's. Currently a website pages having underscore in it, I would like to use hyphen (-) in between the words. Here is URL: http://www.cleanitsupply.com/t-Janitorial_Supplies_New_York_City.aspx Please suggest me how I can use URL enforce write to re-write URL's without 301. Your quick answers will be appreciated. Note: This page having back external backlinks. Thanks
Technical SEO | | younus0 -
During a site platform transition, should we 301 redirect all URLs or only those with inbound links?
We have an ecommerce client transitioning to a new platform. Due to the nature of the platform, all the pages will have different URLs. There are between 7000-8000 total pages on the website. We wrote 301 redirects for all URLs which are showing inbound links. Unfortunately, automating this process is pretty difficult and hand writing URLs for 8000 links is unfeasible. Is it worth investing the time to 301 redirect all 8000 URLs, or are we safe with only doing those with inbound links? One other option would be to implement a generic redirect for all the rest of the old URLs that sends them to the homepage. Would this be a good compromise?
Technical SEO | | outofboundsdigital0 -
301 redirect while keeping OLD domain for branding
Say you have CharityName.com. They use a dedicated domain name CharityNameEvent.com to advertise their main event. They use this domain on posters, flyers,etc and want to keep using it because it's easier to remember. CharityNameEvent.com has far, far more inbound links than CharityName.com (about 8 times more). Current problem: their current web developer has put the SAME content on both websites instead of setting up a redirect from CharityNameEvent.com (easy to remember) to CharityName.com/Event which would have made more sense. My intention is to consolidate the 2 websites and make sure CharityName.com benefits from links to the Event. I plan to move and 301 redirect CharityNameEvent.com to CharityName.com/Event. I know this would keep links and PR intact but I have a couple of questions: 1. Is it enough to set up the 301 redirect or would they have to ask websites to ACTUALLY change the links to CharityName.com/Event? 2. They plan and need to keep using CharityNameEvent.com for its ease of use on posters, flyers, etc. The 301 redirect would be in place. Would this cause any problems with search engines, especially when/if some people STILL link to CharityNameEvent.com instead of CharityName.com/Event? Basically, my understanding of 301 redirects is that they're used when a website permanently moves. In this case, the OLD DOMAIN name would still be used for reasons mentioned above but would be 301 redirected to CharityName.com/Event. Any chance this might not maximise the potential of new/old links? Any other way to go about it? Anything I'm missing with this scenario? Thanks
Technical SEO | | carmenmardiros0 -
Blog URLs
I read somewhere - pretty sure is was in Art of SEO - that having dates in the blog permalink URLs was a bad idea. e.g. /blog/2011/3/my-blog-post/ However, looking at Wordpress best practice, it's also not a good idea to have a URL without a number - it's more resource hungry if you don't , apparently. e.g. /blog/my-blog-post/ Does anyone have any views on this? Thanks Ben
Technical SEO | | atticus70