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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.