Jump to content

mod_rewrite help


cmgmyr
 Share

Recommended Posts

I have a site that has dynamic kiosk stores and I can't seem to get everything to work how I want it to.

 

1. I need url.com/kiosk_name going to url.com/store/index.php?kiosk=kiosk_name (which I have that so far).

2. I need url.com/kiosk_name/products.php going to url.com/store/products.php?kiosk=kiosk_name

3. This also needs to handle a query sting...url.com/kiosk_name/products.php?product=1 going to url.com/store/products.php?kiosk=kiosk_name&product=1

 

Here is what I have so far:

RewriteEngine  on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-F
RewriteRule ^([^/\.]+)/([^/\.]+)?$ $2?kiosk=$1 
RewriteRule ^([^/\.]+)/?$ store/index.php?kiosk=$1 [L]

 

I know I'm doing something wrong and I'm sure some other things need to be added. What should this be?

 

Thanks,

-Chris

Link to comment
Share on other sites

I altered the code a little bit, here is what I have now:

RewriteEngine  on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-F
RewriteRule ^([^/\.]+)/?$ store/index.php?kiosk=$1 [L,PT] 
RewriteRule ^([^/]*)/([^/]*)$ store/$2?kiosk=$1 [QSA,L,PT] 

 

Now, the virtual directories work 100%, but when I go to the root of the site, or any of the files in the root the CSS and the images do not come up. How can I adjust this code so that it doesn't effect the root files?

 

Thanks,

-Chris

Link to comment
Share on other sites

This thread is more than a year old. Are you sure you have something important to add to it?

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.

 Share

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