Jump to content

First Time! Little Help Please. I started it but now stuck!


paulman888888

Recommended Posts

Hi guys;

 

I don't no how to explain so i shall use an example.

 

Users go to events.html

MOD REWRITE shows page index.php?where=events

THAT ABOVE WORKS FINE. But when i want to start using GET variables i get stuck.

 

Users go to events.html?var_name=var_value

MOD REWRITE shows page index.php?where=events&var_name=var_value

I cant do the above because...

 

The problem is that the GET variables will always change includeing value and name, i dont want to use loads of sub-folders like

var_name/var_value/events.html

 

How can i solve this problem?

 

Please help me

Thankyou all in advance

Paul Hutchinson

You can setup another divider besides a forward slash (fake folders). You could have the url be something like:

variablename~value/events.html

 

The key is something unique. How you build your URL is your choice, just need to make the mod_rewrite understand it.

If you just want the query string to be PASSED ON (they go to /home?something=else and it redirects to home.html?something=else), just add the following flag at the end of the rule: [QSA]

 

For instance:

RewriteRule ^/product/([0-9]*)/?    /product.php?product_id=$1    [QSA]

 

Maybe I'm just not understanding your question.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.