Published in: PHP
.htaccess:
RewriteEngine On
RewriteBase /
images.php, browse.php, index.php
RewriteRule ^(images|browse|index)(/.*)?$ $1.php
above can obviously be expanded
GoDaddy users add this to the beginning of your htaccess or you will throw an error
Options +MultiViews +FollowSymLinks
make sure you wait about 5-10 minutes after uploading the revised .htaccess, for some reason, GoDaddy takes a few minutes to revise the .htaccess
<?php if($url_what == 'home') { // rather than index.php?act=home, url would be index/home displayHome(); }elseif($url_what == 'contact'){ // rather than index.php?act=contact,url will be index/contact displayContact(); }elseif($url_what == 'calendar'){ // rather than index.php?act=calendar,url will be index/calendar displayCalendar(); }elseif($url_what == 'about'){ // rather than index.php?act=about,url will be index/about displayAbout(); }else //if $url_what doesn't exist, display home writeHome(); ?>
Comments
Subscribe to comments
You need to login to post a comment.

Nice one! Thanks :)
No problem!