Forum Moderators: phranque

Message Too Old, No Replies

mod rewrite question for noob

can't get rewrite rule working correctly

         

ykcul

2:48 pm on Oct 19, 2007 (gmt 0)

10+ Year Member



I have searched all around but can't seem to find the answer and can't figure it out for myself.

Basically i have a search folder (www.domain.com/search) with an index.php file that takes care of everything.

I want to take anything after the '/search/' in the url and use it for the search term.. so if the url is 'www.domain.com/search/ponies' the mod_rewrite would render index.php and i could grab the 'ponies' for my search term using REQUEST_URI.

I am completely new to apache mod_rewrites, I used to not touch the stuff but now I have been thrown into the fire.

My rewrite rule is as follows..

RewriteEngine On
RewriteCond ${IS_SUBREQ} false
RewriteRule ^(/.*)$ index.php

But anything after the search will just give it a 404.
I am using an .htaccess file on the directory.

Any help would be appreciated... thanks

ykcul

3:13 pm on Oct 19, 2007 (gmt 0)

10+ Year Member



never mind...

the slash was messing it up

should of just been

RewriteRule ^(.*)$ index.php