Forum Moderators: phranque
to be re-written as:
So far I have tried making a .htaccess file containing:
RewriteEngine on
RewriteRule /(.*)/(.*) /index.php?pg=$1&sc=groups/$1/main/$2
and put in in the pictures directory, but this doesn't work, it's opening the subdomain's root index.php file and not the index.php file in /pictures/.... any advice?
I am running apache and mod_rewrite is fully enabled etc.
Thanks for any and all help!
Andrew. :)
Welcome to WebmasterWorld [webmasterworld.com]!
You can do one of several things. One of these three options might help:
1) Include "pictures/" in the regular-expressions substitution that your RewriteRule is using in the pictures directory:
RewriteEngine on
RewriteRule ^(.*)/(.*) [b]/pictures[/b]/index.php?pg=$1&sc=groups/$1/main/$2 [L]
2) Omit the leading slash in the regular-expressions substitution that your RewriteRule is using in the pictures directory:
RewriteEngine on
RewriteRule ^(.*)/(.*) [b]index[/b].php?pg=$1&sc=groups/$1/main/$2 [L]
3) Include "pictures/" in the pattern *and* the substitution, and place the code in your Web root directory:
RewriteEngine on
RewriteRule ^[b]pictures/[/b](.*)/(.*) [b]/pictures[/b]/index.php?pg=$1&sc=groups/$1/main/$2 [L]
I'd recommend option one or three, as they are more "precise" and less likely to lead to confusing problems later.
Jim