- Code: Select all
RewriteRule (.*)/(.*) ./index.php?area=$1&content=$2
I then add:
- Code: Select all
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !\..+$
RewriteCond %{REQUEST_URI} !/$
RewriteRule (.*) http://www.mydomain.com/$1/ [NC,QSA,L]
to this, to ensure trailing slashes.
Now what I want to do is add one more level of subfolder to some of the folders - so I could have
www.mydomain.com/web/tutorials/using-htaccess
which when rewritten should give (for example)
www.mydomain.com/index.php?area=web&content=tutorials&subcontent=using-htaccess
I've tried the obvious -
- Code: Select all
RewriteRule (.*)/(.*)/(.*) ./index.php?area=$1&content=$2&subcontent=$3
but that won't work for the original URLs with only one extra element - eg for
www.mydomain.com/blog
when I get a "can't find /blog/" 404 error.
Is there a way to use three levels?
Many thanks for any help