apache - Manipulate user's address bar with mod_rewrite -
apache - Manipulate user's address bar with mod_rewrite -
i have page @ example.com/themizer.php
, want appear it's located @ example.com/themizer/
(or example.com/themizer/index.php
) practical purposes. know how create alias mod_rewrite, how create appear users beingness redirected alias? example: user requests example.com/themizer.php
, address in browser turns example.com/themizer/
without redirecting. possible?
with server-sided configuration, can accomplish redirect. not need problem. create sure urls on site point fancy url , not internal url. otherwise generate lot of requests have redirected, instead of redirecting odd request came in in other way (e.g. through external old url or old bookmark). this:
#external redirect rewritecond %{the_request} ^get\ /themizer\.php\ http rewriterule ^themizer\.php$ /themizer/ [r,l] #internal rewrite rewriterule ^themizer/?$ themizer.php [l]
if must, can utilize javascript 'push' new window state history, updating address bar. causes "go previous page" button in browser contain bogus though. in other words: going previous page not work expected, not recommend since there improve alternative available. can next javascript statement in browsers back upwards it:
window.history.pushstate( null, document.title, "/themizer" );
apache .htaccess mod-rewrite installation
Comments
Post a Comment