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 - New URL structure
Hi, Currently we have the following url structure for all pages, regardless of the hierarchy: domain.co.uk/page, such as domain/blog name. Can you, please confirm the following: 1. What is the benefit of organising the pages as a hierarchy, i.e. domain/features/feature-name or domain/industries/industry-name or domain/blog/blog name etc. 2. This will create too many 301s - what is Google's tolerance of redirects? Is it worth for us changing the url structure or would you only recommend to add breadcrumbs? Many thanks Katarina
Technical SEO | | Katarina-Borovska1 -
Moving to old site to new domain sub directory
Hi, we've moved our old site to a new domain but in a subdirectory (the shopping site has been consolidated into overarching company website's shopping section, thus the move to sub dir). Are 301 redirects from old URLs to new domain's subdirectory ex newsite.com/shopping/page-1/ sufficient for site migration? I wasn't able to use Google's site address change tool since we're moving to a subdirectory on the new domain. Thanks
Technical SEO | | SoulSurfer80 -
Redirect 'keyword-url' to improve ranking?
I was wondering if a good url, with a keyword in it, can help you improve the position of that certain keyword by redirecting that url to your website. To make it clear: We run the website www.terello.nl, and have the possibility to let the url www.iphonereparatie.nl (translation: iphonerepair) redirect to our website. Would this help us to rank for the keyword 'iPhone reparatie'? I hope that I made myself clear this way:) Otherwise i'm more than happy to clearify myself!
Technical SEO | | Jan-Peter0 -
Concerned about Dup content between old and new website
I have an 8 year old plastic surgery website with my name in the url. I have just released a new website with a generic local plastic surgery url without my name. However my google authorship photo is appearing in listings from both sites with different URLs. So far Google is listing pages from both sites on the same google page result for similar search terms. However I am concerned that eventually I may be punished for dup content since I am the same author for both pages?
Technical SEO | | wianno1680 -
Robots.txt | any SEO advantage to having one vs not having one?
Neither of my sites has a robots.txt file. I guess I have never been bothered by any particular bot enough to exclude it. Is there any SEO advantage to having one anyways?
Technical SEO | | GregB1230 -
301 Redirect Clarification: Images, Paramter URLs, etc.
I know that going through a site redesign it's essential to make sure that 301s are implemented for any changed URLs, but I wasn't sure if this was the same for the images on the page and the parameter URLs that are created by marketing campaigns - do those URLs also need to be 301 redirected? For example, this URL: www.mysite.com/32-inch-round-aluminum-table/ Could have a parameter at: www.mysite.com/32-inch-round-aluminum-table/?utm_source=twitterfeed&utm_medium=twitter&utm_campaign=Social%3A+My_Site And an image at: www.mysite.com/images/32-inch-round-aluminum-table.jpg Would the first two URLs mentioned need to be redirected to the new URL, and the image redirected to the new image URL? Thanks for the help.
Technical SEO | | eTundra0 -
IP redirects
My website, on a .com domain, displays a different language/content depending on the IP of the user. For example, if someone is browsing my web from Spain, it will show the spanish content, and so on. Does anyone has an idea on how will Google index my pages? Their servers being located in the US, I assume the bot will only crawl and index the english content. How can I tell the bots to do the same for the other languages/content? Thanks!
Technical SEO | | Alemoto0 -
Moving Old Site to New
Dear SEO Gurus, I have been working on #2 site for a couple of months and I think it is a good idea to redirect #1 (old site) to #2 (new site) below, yes? What is the most effective way of doing this? Do I have to 301 Redirect one page from the old site to a relevant page on the new site and do this for every page.... or can I do a 301 redirect for the whole old site to the new site? Thank you for your time in advance for helping me out! Sheryl | | 1 | Gazpachos - Restaurnte Y CantinaExplore http://www.gazpachorestaurant.com/ |
Technical SEO | | TOMMarketingLtd.
| 2 | Gazpacho's RestaurantExplore http://www.restaurantsdurango.com/ | Page Authority | Page Linking Root Domains | Domain Authority | Root Domain Linking Root Domains |
| 42 | Check_big_gray 36 | 30 | 37 |
| 21 | 1 | 6 | 1 |0