httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Andersson" <>
Subject Re: [users@httpd] Another mod_rewrite question
Date Thu, 11 Dec 2003 14:39:06 GMT
Sean Correia wrote:
> I have a mix of static and dynamic pages on my site, and need
> a mechanism that if a user requests /bar/foo.shtml and if is not
> found the server will use /bar/foo.phtml

This might work:

    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)\.shtml$ $1.phtml

The condition for the rule is that the requested file doesn't exist, and the
rule will change the file extension. Might require some tweaking though;
read up on the docs to verify what it does and if it cause trouble, check
the rewrite log.

Robert Andersson

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message