Rewriting When Requested File Is Not Found

Using a single web hosting account to host multiple sites

Rewriting When Requested File Is Not Found

Postby Guest » Mon Oct 04, 2004 3:13 am

I'm looking to use mod_rewrite to impersontate a 404. So if the requested page doesn't exist, rewrite. If it does exist, just serve it up.

This is the closest I got:

Code: Select all
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^.*$ [URL to substitute]


Anyone have any ideas?

Deane
Guest
 

Postby seomike » Mon Oct 04, 2004 9:18 pm

RewriteCond %{REQUEST_URI} -f [NC]
RewriteCond %{REQUEST_URI} -d
RewriteRule ^.*$ http://www.domiain.com/404.htm [R=404,L]

Try that.
seomike
 
Posts: 331
Joined: Thu May 06, 2004 7:36 pm
Location: Dallas


Return to Domain Handling

Who is online

Users browsing this forum: No registered users and 88 guests

cron