httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "/dev/null" <dev.n...@BeginThread.com>
Subject [users@httpd] How to rewrite URL if substitue file exists?
Date Thu, 25 Sep 2003 04:43:22 GMT
apache 1.3.27

I've played around with internal rewrites in the past, but it was always "if
the url is z, make it a".  This time it's a little different.

Basically I have a tool that spits out our HTML pages, builds navigation
links, etc...  But it can only do it with HTML pages.  A couple of our pages
are php.  Well, we build the "shell" html page and let the navigation get
built with that, then we pull the resulting HTML into our php file and
insert the php code where it goes.  We've got it all automated, so it works
nice.

Not all the pages have equivalent php pages, or we could roughly do this:

RewriteRule (.*).html$ $1.php

And we don't want to build ever php rewrite rule by hand, because any time
we took a php page in or out we'd have to edit the httpd.conf and restart
the server.  If we did want to do it, it would look something like this:

RewriteRule /firstpage.html firstpage.php
RewriteRule /secondpage.html secondpage.php
RewriteRule /thirdpage.html thirdpage.php

Instead what we want is something like this (but don't know how to do it):

for file (.*).html if $1.php exists, rewrite, otherwise let the html page be
used.

That way all the nav links will all work fine and from the user's
perspective only html pages are being served up.

Thanks for any help!


---------------------------------------------------------------------
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