Is there a way to redirect URLs with a hash-bang (#!) format?
-
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!
-
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 -
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".
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
-
Trailing slash redirects not working in https - working in http: What might be the culprit?
Hi, Our WP website redirects without slash to with slash are not working. When we tried with http mode, they are working. So, not working on https mode. Correct code given at .htaccess file. What might be causing the issue? Thanks
Web Design | | vtmoz0 -
I have a site that has a 302 redirect loop on the home page (www.oncologynurseadvisor.com) i
i am trying to do an audit on it using screaming frog and the 302 stops it. My dev team says it is to discourage Non Human Traffic and that the bots will not see it. Is there any way around this or what can I tell the dev team that shows them it is not working as they state.
Web Design | | HayMktVT0 -
Should I Redirect Pagination?
Working on a redirect map for a client moving platforms and they have all of their category pagination indexed - no canonical link and no rel next/prev's on any of them. Should I redirect the pagination pages to the main category page on the new platform? Or Should I allow the pagination to de-index itself type of thing? Thoughts and experience?
Web Design | | paul-bold0 -
We use bigcommerce platform and want to access the bigcommerce server to change the way our product images display
Hi We use bigcommerce and want to chage the way we display multiple images for our products. At the moment in bigcommerce you switch between images by clicking the next image, we want the images to change when we hover the curser over the image. Does anyone know how to do this ? Regards Adrienne
Web Design | | CostumeD0 -
How to rewrite/redirect a folder name with .htaccess
I have a folder in my site that I want to rename. I don’t want to just rewrite the URL and keep my old folder name, I want to change the folder name and then do whatever is necessary with .hataccess to not lose search engine rankings. The folder name I want to change has a space in it and also is misspelled (whoops x2) Example. Mysite.com/old foldr/page.html Mysite.com/newfolder/page.html How would I go about doing this with .htaccess? Do I just switch the folder name on my server and then set up a redirect, or do I do a rewrite? Sorry now familiar with the terms or .htacces. Thanks all
Web Design | | SheffieldMarketing0 -
Google fails to pick out the correct URL of the story
Hi , I have a page with many news storeys on it. Google craws the page but it picks up a more general url even though I've embedded the direct URL within anchor tags around the headline . The snippet below got linked by Google to http://www.irishnews.com/ Any idea how i can get Google to pick-up http://www.irishnews.com/news.aspx?storyId=1180708 would be very welcome Peter Quinn: Family made scapegoats of financial crisis News Peter Quinn: Family made scapegoats of financial crisis THE Quinn family have been made scapegoats of the financial crisis surrounding the former Anglo Irish Bank, tycoon Sean Quinn's brother Peter claimed yesterday.Peter Quinn, a former president of the GAA, said hi read more»
Web Design | | Liammcmullen0 -
Type of redirect?
I'm almost ready to launch a website redesign. We are going to move what's currently being hosted on olddomain.com to newdomain.com. We want to do this early to avoid error and to have olddomain.com redirect to newdomain.com until the new content is ready. Once the redesign is complete, we'll push the new content to olddomain.com (as it holds a higher SEO value) and take away the redirect. A. Does this sound like a good idea? B. What kind of redirect should I use? 302? 307? Thanks, and sorry for the confusion 🙂
Web Design | | kylesuss0 -
Javascript changing URL - Thoughts?
So, our developer just created a player at the bottom of this site I work for. It's not really important what it is. The thing is, when you go to our home page now, the javascript changes the url from www.site.com to www.site.com/home It's not actually redirected or anything (no 301, it's just the javascript doing this), but I'm worried that if someone links back to our site they're going to surely pull that URL to point back to, which is wrong. Also, when you go to a category, the URL changes from www.site.com/category to www.site.com/home#category. Again, it's not a redirect but I'm still worried people will link back to this since it's on the entire site now... I'm suggesting that we turn off this new feature until we find a workaround. I just wanted to confirm with you guys that this is best. Thanks
Web Design | | poolguy0