httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Andersson" <rob...@profundis.nu>
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.

Regards,
Robert Andersson


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message