I'm still finding difficulty rewriting the htaccess to make the url a bit pretty.
this is the actual url:
http://mydomain.com/folder/page.php#_=_
I want to rewrite the above to:
http://mydomain.com/folder/page
I tried this approach after following various tutorials but its not working:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^([a-zA-Z0-9_-]+)$ hhttp://mydomain.com/folder/page.php#$1
RewriteRule ^([a-zA-Z0-9_-]+)/$ http://mydomain.com/folder/page$1
</IfModule>
I know its wrong but I really don't know how to do it properly.
any help is greatly appreciated. TIA
#_=_
won't be passed to the server (actually it's not a part of URI).
The only way is to do it with JavaScript (on client side) instead of with PHP (on server side):
if (location.hash === "#_=_") {
location.replace(location.href.replace(/#.+/, ""));
}
But it seems not necessary.
Use this
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^folder/page.php#_=_$ folder/page [L,R=301]
</IfModule>