Forum Moderators: phranque
[mydomain.com...] (must end in .html only)
is rewritten to:
[mydomain.com...] (note no .html)
Here is the mod-rewrite I am using
RewriteCond %{REQUEST_URI} ^/([a-zA-Z]+)\.html$
RewriteRule ^(.*)$ [%{HTTP_HOST}...] [R=301,L]
The problem that I am having is that $1 is passing the entire anything.html and not just anything
RewriteRule ^([^.]+)\.html$ /buildpage.php?page=$1 [L]
More here: Changing dynamic to static URLs [webmasterworld.com].
Jim
Thanks a ton! Appreciate it!
On another note - I can't find any reference on using text functions within mod-rewrite (including the link you provided). For example, I want to pass only the second level domain from the {HTTP_HOST} variable. I have already made sure that all domains will start www but I can't find if I can use a function somewhere.
Thanks,
Matt
For more information, see the documents cited in our forum charter [webmasterworld.com] and the tutorials in the Apache forum section of the WebmasterWorld library [webmasterworld.com].
Jim