httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Andersson" <>
Subject Re: [users@httpd] Content Negotiation and PHP
Date Thu, 14 Oct 2004 13:55:46 GMT
Chris Simon wrote:
> Yes, it's extension hiding that I really want, not the negotiation, as 
> there will not be both .html and .php files of the same name.  I just want 
> to write my site with extensionless links from the start using .html 
> files, then in the future rename them to .php without breaking links or 
> bookmarks.

I wish more people were as thoughtful as you. However, I think having URIs 
ending in .html is OK, since that is the format the client gets regardless 
if it is PHP, ASP, Perl that is generating it.

> The only problem is if the rewrite will cause the extension to appear
> in the address bar

No, not unless you append the [R] flag to the rewrite rule. As it was, it 
should be an internal redirect.

You can also have a rule like this:
    RewriteRule ^(test1|test2|test3)$ $1.php [L]

However, if you have many documents, I suggest trying my other alternative, 
that automatically rewrites "all" requests that exists with the extension 

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