Forum Moderators: phranque

Message Too Old, No Replies

Newbie need re-write help

         

asmith3006

12:58 pm on Mar 20, 2004 (gmt 0)

10+ Year Member



Hi all.
I've been reading this forum and the help you give is great!
The trouble is I don't really understant it.... I'm a COMPLETE novice to all of this stuff.
I've asked several people about this already and they have been unsuccessful....... third time's a charm :D
Right, what I want is:

[subdomain.domain.co.uk...]

to be re-written as:

[subdomain.domain.co.uk...]

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. :)

jdMorgan

3:14 pm on Mar 20, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



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]

-or-

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]

-or-

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

asmith3006

8:07 pm on Mar 21, 2004 (gmt 0)

10+ Year Member



Option number 1 has worked wonderfully! Thanks alot!
Now I just need to sort out the html a bit, it doesn't like working with iframes it seems :S

Thanks again!
Andrew.