View Full Version : How do I redirect urls with .html extensions to extensionless urls?

01-02-2008, 09:02 AM
I'm in the process of moving a site to Textpattern and I've run into some trouble with my urls. In the old site, the url for a given page is of the form http://localhost/folder/file.html. I was able to configure Textpattern, via its GUI, to serve up pages with urls in the form of http://localhost/folder/file. I've been trying to use a ModRewrite rule in my .htaccess file in the root of my site make Textpattern serve up the proper page when the URL with the .html extension is requested. Here's the rule I've been trying:

RewriteRule ^(.*).html$ $1 [R]

When I try browsing to the .html url, Apache serves me this:


I can't figure out why it's forwarding it to the path of the file from the root of my harddrive rather than the root of the site. I'm also surprised that index.php is included in that URL. I'm thinking that it could be a conflict with the existing rewrite rules from Textpattern, but I'm pretty lost. Anyone have an idea as to what's going on?

01-05-2008, 03:58 PM
Yeah, I would like to know this too!

03-16-2008, 04:36 PM
bump.. Is this possible?