Link to home
Start Free TrialLog in
Avatar of Benji_
Benji_Flag for United Kingdom of Great Britain and Northern Ireland

asked on

mod_rewrite

Hi Guys,

Wondering if you can help shed some light on my problem,

At the moment im makng a system where i have
http://url/index.php?page=cnt_name

sometimes i  then need to pass variables to pages if i want to skip
http://url/index.php?page=cnt_name&funct=1&blah=2

i have attached my htaccess file,

is there a way that i can have it so

http://url/page

but then if i want to add variables it can be

http://url/page?variable=1&variable=2&blah=3

without having to create a rule within htaccess file for each page?

Best Regards
ben



RewriteEngine on
###################################################
# Do not process images or CSS files further      #
###################################################
# No more processing occurs if this rule is       #
# successful                                      #
###################################################

RewriteRule \.(css|jpe?g|gif|png)$ - [L]


RewriteRule ^([^/\.]+)/?$ /index.php?page=$1 [L]

Open in new window

SOLUTION
Avatar of arober11
arober11
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Benji_

ASKER

Hi,

i tried the above code, now i think i might just be besing stupid

the first bit how dows that understand what  cnt_name is  becuase cnt_name changes depending on what the page variable is, and how to you apend a variable to a string?

Best regards
ben
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Benji_

ASKER

Thanks Guys