The Moz Q&A Forum

    • Forum
    • Questions
    • My Q&A
    • Users
    • Ask the Community

    Welcome to the Q&A Forum

    Browse the forum for helpful insights and fresh discussions about all things SEO.

    1. SEO and Digital Marketing Q&A Forum
    2. Categories
    3. Technical SEO Issues
    4. How can I redirect old URLs to new ones?

    How can I redirect old URLs to new ones?

    Technical SEO Issues
    12 4 7.2k
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as question
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • personalproducts
      personalproducts last edited by

      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.

      1 Reply Last reply Reply Quote 0
      • NakulGoyal
        NakulGoyal last edited by

        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.

        personalproducts 1 Reply Last reply Reply Quote 0
        • blu42media
          blu42media last edited by

          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

          personalproducts 2 Replies Last reply Reply Quote 2
          • personalproducts
            personalproducts @NakulGoyal last edited by

            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 =[

            1 Reply Last reply Reply Quote 0
            • personalproducts
              personalproducts @blu42media last edited by

              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:

              _http://personal-products.co.uk/toiletry-travel-bags_

              blu42media personalproducts 3 Replies Last reply Reply Quote 0
              • blu42media
                blu42media @personalproducts last edited by

                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

                1 Reply Last reply Reply Quote 1
                • jim_cetin
                  jim_cetin last edited by

                  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.

                  personalproducts 2 Replies Last reply Reply Quote 1
                  • personalproducts
                    personalproducts @personalproducts last edited by

                    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!

                    1 Reply Last reply Reply Quote 0
                    • personalproducts
                      personalproducts @jim_cetin last edited by

                      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

                      1 Reply Last reply Reply Quote 0
                      • personalproducts
                        personalproducts @jim_cetin last edited by

                        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...

                        1 Reply Last reply Reply Quote 0
                        • personalproducts
                          personalproducts @blu42media last edited by

                          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

                          1 Reply Last reply Reply Quote 0
                          • blu42media
                            blu42media @personalproducts last edited by

                            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

                            1 Reply Last reply Reply Quote 0
                            • 1 / 1
                            • First post
                              Last post
                            • Root domain change - should we update existing backlinks which include the redirect from the old root domain to the new one?
                              GFD_Chris
                              GFD_Chris
                              0
                              2
                              29

                            • 301 Domain Redirect And Old Domain to a New one including pages
                              brooksmanley
                              brooksmanley
                              0
                              2
                              62

                            • Can new content be added to a url which has a 301 redirect?
                              AlanMosley
                              AlanMosley
                              0
                              7
                              129

                            • I've consolidated other domains to a single one with 301 redirects, yet the new domain authority in MOZ is much less that the redirected ones. Is that right?
                              MashBonigala
                              MashBonigala
                              2
                              3
                              232

                            • Changed URL of all web pages to a new updated one - Keywords still pick the old URL
                              danatanseo
                              danatanseo
                              0
                              2
                              331

                            • I'm redesigning a website which will have a new URL format. What's the best way to redirect all the old URLs to the new ones? Is there an automated, fast way to do this?
                              GregFindley.co.uk
                              GregFindley.co.uk
                              0
                              2
                              303

                            • New project old domain should I 301 redirect while new sites built
                              MikeDelaCruz77
                              MikeDelaCruz77
                              0
                              3
                              346

                            • Can I redirect a URL that has a # in it? How?
                              ASOS
                              ASOS
                              0
                              7
                              422

                            Get started with Moz Pro!

                            Unlock the power of advanced SEO tools and data-driven insights.

                            Start my free trial
                            Products
                            • Moz Pro
                            • Moz Local
                            • Moz API
                            • Moz Data
                            • STAT
                            • Product Updates
                            Moz Solutions
                            • SMB Solutions
                            • Agency Solutions
                            • Enterprise Solutions
                            • Digital Marketers
                            Free SEO Tools
                            • Domain Authority Checker
                            • Link Explorer
                            • Keyword Explorer
                            • Competitive Research
                            • Brand Authority Checker
                            • Local Citation Checker
                            • MozBar Extension
                            • MozCast
                            Resources
                            • Blog
                            • SEO Learning Center
                            • Help Hub
                            • Beginner's Guide to SEO
                            • How-to Guides
                            • Moz Academy
                            • API Docs
                            About Moz
                            • About
                            • Team
                            • Careers
                            • Contact
                            Why Moz
                            • Case Studies
                            • Testimonials
                            Get Involved
                            • Become an Affiliate
                            • MozCon
                            • Webinars
                            • Practical Marketer Series
                            • MozPod
                            Connect with us

                            Contact the Help team

                            Join our newsletter
                            Moz logo
                            © 2021 - 2026 SEOMoz, Inc., a Ziff Davis company. All rights reserved. Moz is a registered trademark of SEOMoz, Inc.
                            • Accessibility
                            • Terms of Use
                            • Privacy