Forum Moderators: phranque

Message Too Old, No Replies

apache re-write help

it's just a line or two so please try it :)

         

walkman

3:48 pm on Mar 6, 2004 (gmt 0)



For some weird reason Slurp still has an old copy of my homepage or something and it's asking for older files, before I did the re-write.

I have it done (some else did it ) so /static/keyword displays the /php/index.php?keyword (the url is still /static/keyword on the browser) via:
RewriteRule ^(.+)/static/$ php/index.php?$1

I had live searches linked so SEs would index them, and now I need the reverse. I would like that when you search for
/php/index.php?keyword it takes you directly to /static/keyword. I tried swapping the words above but no luck. A 301 redirect would be fine too.
please help

thank you

walkman

3:30 am on Mar 12, 2004 (gmt 0)



anyone willing to help the brotha ;) out?

Please?

closed

4:32 am on Mar 12, 2004 (gmt 0)

10+ Year Member



You've got the order switched for static and keyword in between the ^$.

walkman

5:03 am on Mar 12, 2004 (gmt 0)



"You've got the order switched for static and keyword in between the ^$."
I hate to say but I'm still clueless. Someone else did the original one too. Sorry.

closed

5:12 am on Mar 12, 2004 (gmt 0)

10+ Year Member



You guys have got to do your homework before you ask questions here! No wonder it seems so hard.

Replace this part:

^(.+)/static/$

so that it looks like this:

^static/(.+)$

You see how it's switched now? ;)

woro2006

1:42 pm on Mar 12, 2004 (gmt 0)

10+ Year Member



walkman,
I think the correct solution would be

RewriteCond %{REQUEST_URL} ^index.php [NC]
RewriteCond %{QUERY_STRING} (.+)$
RewriteRule ^(.*) /static/%1 [L]