Forum Moderators: phranque
RewriteEngine on
RewriteCond %{REQUEST_URI} /extensionlessurl [NC,OR]
RewriteCond %{REQUEST_URI} /exntensionless [NC]
RewriteRule ^(.+)$ http://example.com/$1.php [L]
I've also tried:
%{REQUEST_FILENAME} and all variations of ^/extensionlessurl$ or ^http://example\.com/extensionlessurl$
I know you guys get a lot of these, sorry for the clutter and thanks in advance for the help.
Gabe
Try this, and let us know if it works:
RewriteEngine on
RewriteRule ^foo\.html$ http://www.google.com/ [R=301,L]
This will confirm that *any* mod_rewrite code can run on your server. If it doesn't work, then it's a configuration problem, not a coding problem.
Jim
Do this and see if it helps:
RewriteEngine on
RewriteCond %{REQUEST_URI} ^/full_extensionless/url-path from_Web_root_directory$ [OR]
RewriteCond %{REQUEST_URI} ^/another_full_extensionless/URL-path$
RewriteRule (.+) http://example.com/$1.php [L]
A URL-path from root means a path such as "/images/logo.gif" -- The path down from your root directory only, no domain or appended query strings.
Do not use [NC] to make the rule accept URLs with case errors. This potentially creates massive duplicate-content problems. Instead, if requested URL case errors are common, externally redirect the mis-cased URLs to the proper-cased URLs before applying this internal rewrite.
Concise tutorials for regular expressions are available through links in our forum charter, and in a post in our forum library.
Jim
I guess I just needed to cry wolf to get him away.
Thanks,
Gabe