0

I've seen many samples in PHP here but no one answer to my needs. Want to redirect URL with hash (#) such as myserver.com/anyslug/#anyanchor

I've learn the NE (not escape) parameter, but I do not know how to put here without to destroy all my .htaccess file :

RewriteEngine On
RewriteRule ^inc/.*$ index.php
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php [QSA,L]

Thanks,

Gregoor

  • `#anyanchor` is not passed to a server. – u_mulder Apr 30 '17 at 09:32
  • Try this: http://stackoverflow.com/a/15135130/5873008, or maybe you need [parse_url](http://php.net/manual/en/function.parse-url.php) and [parse_str](http://php.net/manual/en/function.parse-str.php) – alistaircol Apr 30 '17 at 09:33
  • Thanks but what will be these 3 lines of .htaccess file if the rule is not only for articles page folder but all files such as http://example.com/first-article#note1 (no articles) ? Thanks RewriteCond %{REQUEST_URI} !articles\.html [NC] RewriteCond %{REQUEST_URI} ^/articles/([^/]+)/? [NC] RewriteRule .* /articles.html#%1 [R,NE,L] – Gregor Ovitch May 01 '17 at 13:14

0 Answers0