Dashboard | Help Login

blogs@bluerhinos.co.uk

Think Blue
The thinkings from the coders at bluerhinos.co.uk

Search
Archives
January 2010 (1)
November 2009 (1)
July 2009 (1)
January 2009 (3)
December 2008 (1)
Sections
Code Tutorial (3)
Misc (2)
QRCode Button (1)
Server Admin (1)
Os
Debian (1)
Code Tags
PHP (2)
Mysql (1)
Tools
Show/Hide QR Code
Show/Hide Keys
A simple way to make pretty urls
25th January 2010 @ 23:06
If you are like me, you dislike the .php extension for web pages that display content, eg /contactus.php . To me this is a web page that is displaying HTML, so lets give it an .html suffix. but the easist way to implements templates is to use html.

To achieve this easily just create a .htaccess file to redirect .html's to .php.
.htaccess code:
 
RewriteEngine On
RewriteRule (.*).html $1.php [QSA]
 
(The QSA just forwards all variables to the .php script)
Requirements: are apache and mod_rewrite
More Info: http://www.kuro5hin.org/story/2003/7/31/2335/08552
Andrew Milsted | View Source | Code Tutorial | Comments (0)