I want to rewrite a URL from fantastictutorials.com/php.html to fantastictutorials.com/new.php?tut=php
OR
fantastictutorials.com/php/introduction.html to fantastictutorials.com/new.php?tut=php&main=introduction
OR
fantastictutorials.com/CSS/basics/syntax.html to fantastictutorials.com/new.php?tut=CSS&main=basics&sub=syntax
This is what I've come up with:
- Code: Select all
RewriteRule (.*).html http://www.fantastictutorials.com/new.php?tut=$1
RewriteRule (.*)/(.*).html http://www.fantastictutorials.com/catch.php?tut=$1&main=$2
RewriteRule (.*)/(.*)/(.*).html http://www.fantastictutorials.com/catch.php?tut=$1&main=$2&sub=$3
The reason I used the 'OR' is because I think my main problem arises when a URL applys to more than one Rule.
Please give me a hand.
Thanks a lot.