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. Can I redirect a URL that has a # in it? How?

    Can I redirect a URL that has a # in it? How?

    Technical SEO Issues
    7 4 422
    • 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.
    • sfecommerce
      sfecommerce last edited by

      Hi there -

      My web developer is saying that I can't do a URL redirect with a "#" in it. Currently, the URL is actually an anchored link within a page (which the URL indicates with a #). I want to change the content to a new URL, but our website links internally to the old URL, so we would need to do a URL redirect (assume 301).

      Can you tell me if this is possible and how?

      Thanks!

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

        In appache you can set a re-write rule (for 301's) that would apend everything from the # tag to the redirected url.

        EG: website.com/training#1. You could set the rule redirecting the website.com/training to go to awesomesite.com/training and attach the #1 if it existed on the new page.

        We've done it on our site a few times.

        seoug_2005 1 Reply Last reply Reply Quote 1
        • seoug_2005
          seoug_2005 @Daylan last edited by

          Hello Daylan,

          Would you please share the code you used while redirecting

          http://www.website.com/training#   to

          http://www.website.com

          I mean what code to use if i were to redirect the first url to second (removing the # )

          Thanks

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

            I might be wrong but isn't a # done browser side, so I am not sure this is possible as a search engine can't see the # anyway.

            Willing to be proved wrong on this one but think that is the case.......might go and grab one of our techies and check.

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

              Hi -

              Another restriction -  we only want to redirect one of the anchor pages.

              e.g., www.website.com/#training1 - we would want to redirect this.

              www.website.com/#training2 - we would NOT want to redirect this.

              Is this possible?

              ASOS 2 Replies Last reply Reply Quote 0
              • ASOS
                ASOS @sfecommerce last edited by

                Again, that is not possible because of the #. You can't redirect a browser side page.

                There are some tricky things you can do with modern browsers to push things through via ajax but this is another kettle of fish and even then I am not sure that it is possible to 301.

                Sorry!

                A

                1 Reply Last reply Reply Quote 0
                • ASOS
                  ASOS @sfecommerce last edited by

                  Here is the info on pushstates - as mentioned above: https://developer.mozilla.org/en/DOM/Manipulating_the_browser_history

                  1 Reply Last reply Reply Quote 0
                  • 1 / 1
                  • First post
                    Last post
                  • Can you help by advising how to stop a URL from referring to another URL on my website please?
                    Levanniko253
                    Levanniko253
                    0
                    2
                    31

                  • Can redirect URL website also shown on the google ranking? and higher than the original website?
                    Nigel_Carr
                    Nigel_Carr
                    0
                    4
                    57

                  • 301 Redirects, Sitemaps and Indexing - How to hide redirected urls from search engines?
                    LoganRay
                    LoganRay
                    0
                    4
                    3.0k

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

                  • 301 redirects - one overall redirect or an individual one for each page url
                    Kurt_Steinbrueck
                    Kurt_Steinbrueck
                    1
                    4
                    160

                  • How can i redirect a url that has % in it?
                    joseph.chambers
                    joseph.chambers
                    0
                    2
                    605

                  • I can see one url and get one url ( after copying) urgent pls!
                    KeriMorgret
                    KeriMorgret
                    0
                    2
                    634

                  • Is a 302 redirect the correct redirect from a root URL to a detail page?
                    KeriMorgret
                    KeriMorgret
                    0
                    7
                    1.8k

                  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