Can I redirect a URL that has a # in it? How?
-
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!
-
Here is the info on pushstates - as mentioned above: https://developer.mozilla.org/en/DOM/Manipulating_the_browser_history
-
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
-
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?
-
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.
-
Hello Daylan,
Would you please share the code you used while redirecting
http://www.website.com/training# to
I mean what code to use if i were to redirect the first url to second (removing the # )
Thanks
-
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.
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
-
Should we handle this redirect differently?
So our question is should we handle page redirection/rewriting in php or in .htaccess (with a specific problem we are running into outlined below). We have an ecommerce store in a subfolder of our site (example.com/store/). In the next folder down we have a group of widgets(www.example.com/store/widget-group1). Recently we put a .htaccess redirect in the top level folder (example.com/store/.htaccess), in order to re-write some URL’s and also 301 a page to another page. This seems to be negatively affecting our /widgets-group1/ subfolder however (organic traffic to example.com/store/widget-group1) took a nose dive 3 days after putting the .htaccess redirect in place on the /store/ folder and it has not recovered 8 days later). *Nothing appears outwardly wrong with the current setup to the eye when viewing the pages or requesting as googlebot (the only issue being the nose dive in organic traffic lol) *both subfolders are setup in apache config file to allow local overrides of .htaccess as follows: <directory store="" widget-group1="">Options -Indexes FollowSymLinks -MultiViews
Technical SEO | | altecdesign
AllowOverride All
Order allow,deny
allow from all</directory> <directory store="">Options -Indexes FollowSymLinks -MultiViews
AllowOverride All
Order allow,deny
allow from all</directory>0 -
Second URL
Hi We have a .com and a .co.uk Main website is .co.uk, we also have a landing page for the .com If we redirect the .com to the .co.uk, will it create duplicate content ... May seem like a silly question, but want to be sure that that the visitors cant access our website at both urls, as that would be duplicate content Thanks in advance John
Technical SEO | | Johnny4B0 -
Where is the 301 redirect?
Hi, in the last week I take an issue for 301 permanent redirect for a subfolder in the main website! In that folder i have a index.php file for a google map fullscreen edition and the only link who connects the wordpress website with the subfolder is only a direct link! Is that an error of seomoz app or something else? Thanks 1.jpg
Technical SEO | | petrospan0 -
Is 301 redirecting all old URLS after a new site redesign to the root domain bad for SEO?
After a new site redesign ...would it hinder our rankings if we 301 redirected all old URLS that are returning 404 error codes to the root domain (home page) ? Would this be a good temporary solution until we are able to redirect the pages to the appropriate corresponding page? Thanks so much!
Technical SEO | | DCochrane0 -
Automatic redirect to external urls
Hi all, I'm developing a dynamic qr code service.. The service works in the following way: You create an account with an associated QR CODE pointing to a url like:
Technical SEO | | raulo79
- http://domain.me/username The user can change the target of this url.. he can:
- point to an external url ( his website for example)
- point to a vCard download page
- a mobile ready webpage ( no redirection in this case)... Visiting http://domain.me/username my company logo is displayed and we redirect the visitor with a: header("Refresh: 5;URL=http://userdomain.tld"); Google is indexing many user's URLs, this is good for those users pointing to the mobile ready webpage, in this case there is no redirection, but Google is indexing many urls that redirect to an external url and I don't know how to avoid this.. I can't do an header('Location: http://www.example.com/'); because I need to display our logo after redirection.. how can I do google friendly? Sorry for my english, I hope you can undestand the problem. Best regards.
Mauro.0 -
301 Redirect
Hi there, We are re-branding & re-structuring our website, there will be quite a number of 301 re-directs, possibly hundreds. The question is: Should i wait until the re-branding has been completed and do al the 301's in one go?, or should I try and do 301's as i go along? Kind Regards
Technical SEO | | Paul780 -
Should I be redirecting a .gov.au domain to a .com/.com.au Marketing URL?
Hi everyone, First time post - what a great community! On a trial at the moment but will definitely be signing up to PRO. The situation I'm helping to promote an event in Australia (lets call it "myevent"). The event also goes by a nickname "myev" (which isn't searched as much as "myevent"). The event for the most part is promoted offline as www.myevent.com. As it currently stands (and appears to have been the case for a number of years), www.myevent.com and www.myevent.com.au 302 redirect to www.mylocation.gov.au/myev The event is pretty much number 1 for keywords around "my event" and "myev", despite little attention being paid to on page optimisation and issues around duplicate content which I intend to fix. The domain being indexed by Google is www.mylocation.gov.au/myev . Open site explorer stats Open Site explorer shows www.mylocation.gov.au/myev as having a strong domain authority, and hundreds of backlinks. www.myevent.com and www.myevent.com.au have domain authorities in the 20s and about 30-40 backlinks each. The conundrum I've had a chat with the IT guys running the site(s) and they mentioned they'll be switching the way the redirects work, so everything goes to www.myevent.com NOT the .gov.au URL. I've done a bit of reading on the forums and understand that 301s should be used in order to pass the juice/authority from the existing domain (in this case www.location.gov.au/mye). I understand not all of this will be passed. What I'm not sure about is which URL should be the final preferred destination. I may not have a choice - www.myevent.com has been the preferred URL for a long time - but want to know if this will affect the performance in search results if the .com.au isn't used as the final destination (even though we would be redirecting from it)? Any suggestions / ideas / help would be most appreciated. I hope this all makes sense - I'm relatively new to the whole SEO world! Best wishes and many thanks.
Technical SEO | | hergs0 -
Redirect and ranking
Wehave 2 websites for the same keyword Website 1 is indexed on place 2 but we do not like that name any longer it does not fit our long term marketing Website 2 is indexed on place 5 and this domain fits better What will happen if we redirect website 1 to website 2? Fall down to postion 5 Fall down to position 5 and after a certain period we get back at position 2 or 3 thanx in advance for your reply
Technical SEO | | turnon0