• I want to change the permalink structure so that it goes like this :

    /archives/%year%/%monthnum%/%day%/index.html#%postname%

    so that the “index.html” part is followed by a “#”. Currently i get a error when i just add the “#”. How can i escape it if required?
    Thanks for your help.

Viewing 1 replies (of 1 total)
  • You can’t do it easily, since the hash (#) character is treated as the start of a comment in .htaccess and httpd.conf.

    http://httpd.apache.org/docs/misc/rewriteguide.html

    Extended Redirection

    Description:
    Sometimes we need more control (concerning the character escaping mechanism) of URLs on redirects. Usually the Apache kernels URL escape function also escapes anchors, i.e. URLs like “url#anchor”. You cannot use this directly on redirects with mod_rewrite because the uri_escape() function of Apache would also escape the hash character. How can we redirect to such a URL?
    Solution:
    We have to use a kludge by the use of a NPH-CGI script which does the redirect itself. Because here no escaping is done (NPH=non-parseable headers). First we introduce a new URL scheme xredirect: by the following per-server config-line (should be one of the last rewrite rules):

Viewing 1 replies (of 1 total)

The topic ‘Including “#” in permalink structure’ is closed to new replies.