Lovac Posted February 27, 2010 Share Posted February 27, 2010 hello, plz help me hide url for my website. i have link like this: http://www.example.hr/index.php?page=1 START http://www.example.hr/index.php?page=2 ABOUT etc. how can i configure .htaccess file to mask url to something like this: http://www.example.hr/START thx in advance Quote Link to comment https://forums.phpfreaks.com/topic/193551-hiding-url-with-htaccess-help-plz/ Share on other sites More sharing options...
cags Posted February 27, 2010 Share Posted February 27, 2010 Simple answer is you don't. You change all the links on your site then configure .htaccess files to understand the new URIs and translate them to actual URLs. Since 'start' and 'about' are not indicated in the current URL at all it won't be especially simple. The first step is to update your system so that it uses page=start, page=about rather than the numbers, otherwise you will have to use the number in your URL or do some searching on arrival at the page. Once you have done that, simply change where you output URLs to the new format and use a .htaccess file something along these lines... RewriteCond %{REQUEST_URL} !-f RewriteCond %{REQUEST_URL} !-d RewriteRule ^([^/]*)$ /index.php?page=$1 Quote Link to comment https://forums.phpfreaks.com/topic/193551-hiding-url-with-htaccess-help-plz/#findComment-1018918 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.