Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jan 2008
    Posts
    4
    Thanks
    0
    Thanked 1 Time in 1 Post

    How do I redirect urls with .html extensions to extensionless urls?

    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:

    Code:
    RewriteRule ^(.*).html$ $1 [R]
    When I try browsing to the .html url, Apache serves me this:
    Code:
    http://localhost/Applications/MAMP/htdocs/index.php/file
    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?

  • #2
    New Coder
    Join Date
    Aug 2007
    Location
    New York State
    Posts
    97
    Thanks
    28
    Thanked 1 Time in 1 Post
    Yeah, I would like to know this too!

  • #3
    New Coder
    Join Date
    Aug 2007
    Location
    New York State
    Posts
    97
    Thanks
    28
    Thanked 1 Time in 1 Post
    bump.. Is this possible?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •