Portal Home > Knowledgebase > Articles Database > Prevent .php files from showing in address bar
Prevent .php files from showing in address bar
Posted by chocomarker1, 01-12-2011, 01:01 PM |
I'm having the problem that as of now, for everything that I navigate through my website, is with a .php ending. When I click on the logo to get back to the front page, it will display in the bottom left corner the complete URL+index.php and upon clicking on it, index.php will be in the address bar after the URL. Same thing for like referafriend.php or aboutus.php or contactus.php ...
Makes me feel very uncomfortable and I see that many people nowadays have like
www.example.com/#
appear or
www.example.com/contact-us
instead of
www.example.com/contactform.php
Where and how can I do those settings, that it will be like in the above? Thanks for any help in advance. Have managed so far to set up everything for my server without any flaw but this is where my knowledge ends
|
Posted by asciiDigital, 01-12-2011, 01:17 PM |
Add this to your .htaccess file:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php
|
Posted by chocomarker1, 01-12-2011, 01:35 PM |
thanks asciidigital, but isnt there a way to give each php file its own address bar name? just like for the header? because i would like to call like a specific article i am selling on my website
http://www.example.com/tables/ivory-...n-and-polished
instead of
www.example.com/managecatalogue1.php?item=MTE
|
Posted by Aquickhost, 01-12-2011, 02:32 PM |
Use a ajax request in ur main page, or use an iframe, to hide the address link.
Or use the htaccess method.
|
Add to Favourites Print this Article
Also Read
Ezzi.net Down (Views: 896)