Custom Filename Extensions
.htaccess
By | Wednesday, June 6, 2012




Hide Commentshttp://wcetdesigns.com/page.wcet




.htaccess:
Filename must be called .htaccess, which is the filename that will allow your pages to be rewritten with other extensions.
RewriteEngine On

RewriteRule ^([a-zA-Z0-9_-]+)\.wcet$ $1.php

#The rules above mean that any .php can be rewritten as a ".wcet" file
#Example: page.php can be rewritten as page.wcet
#The ".wcet" extension is just an example; it can be changed to something else.
PHP:
page.php, file that will be rewritten with any extension you want.
<?php

echo 'This is the page that should be able to be rewritten.
<a href="page.wcet">See the URL rewritten.</a> '
;

?>