3 replies
I've never been able to really understand .htaccess. I have a folder containing php files with redirects. I'd like a url of the file name without any dashes or folder name.

For example, I can link to http://www.domain.com/ILoveThis which is the same page as http://www.domain.com/r/i-love-this.php

If you can tell me the rewrite rule so all files in the the "r" folder work like this, that would be simply awesome.
#htaccess
  • Profile picture of the author SteveJohnson
    Joshua, you're going to have to do each rule by hand, one at a time. While it's relatively easy to take hyphens OUT, it's impossible to put them back in. So the general form of the redirect, for each file, would be
    Code:
    Redirect 301 /cleanUrl http://www.mydomain.com/r/clean-url.php
    One redirect per line in your htaccess file.
    Signature

    The 2nd Amendment, 1789 - The Original Homeland Security.

    Gun control means never having to say, "I missed you."

    {{ DiscussionBoard.errors[661452].message }}

Trending Topics