WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Hey guys, My WordPress permalink structure is set to `/%postname%/.

When I create a page with a name "FAQs" the permalink generated is "mydomain.com/faqs".

When I link to this page in my code (hardcoded) like this...

<a href="<?php bloginfo('home'); ?>/faqs#b" title="FAQ's">FAQs</a> (pay attention to the #b hash at the end)

...wordpress somehow automatically notices that there is a page /faqs and replaces /faqs#b just with /faqs (without the hash).

Is there a chance I can write a kind of exception to my .htaccess file so WordPress doesn't do that?

Any idea how I could make that work?

share|improve this question
up vote 2 down vote accepted

If your permalink structure is /%postname%/ with a trailing slash, you need to pass the hash like this: /faqs/#b with the trailing slash.

share|improve this answer

The URL hash (everything after the #) does not get sent to the server, so Apache or WordPress can't detect it.

WordPress redirects all URLs to the canonical version of the URL, to make sure everyone uses the same URL when linking to a post (which can help increase your ranking in search engines). This causes a redirect from /faqs to /faqs/. Browsers should append the #hash part to the redirected URL, but it seems IE does not do this.

You can prevent a redirect by using the canonical URL in the URL, like Milo suggested. So link to /faqs/#b and it should work.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.