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] 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 
added.

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