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. Web Design
    4. Is there a way to redirect URLs with a hash-bang (#!) format?

    Is there a way to redirect URLs with a hash-bang (#!) format?

    Web Design
    3 3 886
    • 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.
    • DA2013
      DA2013 last edited by

      Hi Moz,

      I'm trying to redirect www.site.com/locations/#!city to www.site.com/locations/city. This seems difficult because anything after the hash character in the URL does not make it to the server thus cannot be parsed for rewriting.

      Is there an SEO friendly way to implement these redirects?

      Thanks for reading!

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

        I don't believe there is a SEO friendly way of doing this. It's possible to redirect using some JavaScript. However, not SEO friendly (as Matt Cutts puts it):

        "For a while, we were scanning within JavaScript, and we were looking for links. Google has gotten smarter about JavaScript and can execute some JavaScript. I wouldn't say that we execute all JavaScript, so there are some conditions in which we don't execute JavaScript. Certainly there are some common, well-known JavaScript things like Google Analytics, which you wouldn't even want to execute because you wouldn't want to try to generate phantom visits from Googlebot into your Google Analytics".

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

          Perhaps you could try focussing on the exclamation mark (!).

          That you use the HTACCESS file to rewrite the url with the exclamation mark to the url without?

          Something like:

          RewriteRule ^!(.*) http://www.site.com/locations/$1 [R=301,L]

          The exact syntaxis for this statement should come close to this one. I'm not sure that this will work but it might work.

          Regards
          Jarno

          1 Reply Last reply Reply Quote 1
          • 1 / 1
          • First post
            Last post
          • Does redirecting the existing URLs in the website without reducing our current rankings? The new website runs on the bubble, so it seems there is no provisions to redirect the existing URLs to this platform?
            0
            1
            51

          • Is there a way to host my website.com/BLOG URL PATH from a different host than my main website.com host?
            ThompsonPaul
            ThompsonPaul
            0
            6
            53

          • 301 htaccess redirect or 301 HTTP DNS Redirect
            OlegKorneitchouk
            OlegKorneitchouk
            0
            2
            1.4k

          • Is it ok to redirect an old URL to new URL with anchor tag?
            KristinaKledzik
            KristinaKledzik
            0
            6
            1.1k

          • Redirection Problem
            JaneCopland
            JaneCopland
            0
            3
            103

          • Will changing our URL's to MVC friendly URL's have a positive or negative affect on our rankings and link juice?
            SanketPatel
            SanketPatel
            0
            2
            308

          • How to count my urls?
            JamesFx
            JamesFx
            0
            3
            268

          • Redirecting 301 Redirects -- Will Search Engines Notice?
            bemcapaz
            bemcapaz
            0
            3
            870

          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