htaccess Elite

.htaccess tutorial


All times are UTC [ DST ]





Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: re-direct any requests that are not files or dirs
PostPosted: 20 Oct 2006 12:30 
Offline
User avatar

Joined: 25 Sep 2006 04:48
Posts: 242
The option is to place a .htaccess document in the root of the website, and re-direct any requests that are not actual files or directories to a file that will process the request. Below is the .htaccess document that re-directs all of those failed requests to an index.php file for handling. An added bonus of this is that you won't have to worry about any pesky 404 messages, your file will handle the navigation and you can output your own error message.

Code:
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* /index.php [L]


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB