I’m developing a website and trying to obtain:
http://localhost/dir1/dir2/index.html#home
to become:
http://localhost/index.html#home
Tried:
RewriteEngine On
RewriteRule ^/?$ /dir1/dir2/
but no luck, it redirects to http://localhost/dir1/
!
My index.html
file is under /var/www/html/dir1/dir2
folder, as you imagine see from the URL.
Any help please?
Thanks
I’m developing a website and trying to obtain:
http://localhost/dir1/dir2/index.html#home
to become:
http://localhost/index.html#home
Tried:
RewriteEngine On
RewriteRule ^/?$ /dir1/dir2/
but no luck, it redirects to http://localhost/dir1/
!
My index.html
file is under /var/www/html/dir1/dir2
folder, as you imagine see from the URL.
Any help please?
Thanks
*Edit**:
The .htaccess
is placed in the root folder, so in dir1
‘s parent.
2
Answers
to rewrite Rewrite
http://localhost/dir1/dir2/index.html#home
to
http://localhost/index.html#home
use
Try this one: