0 Replies - 6190 Views - Last Post: 03 January 2013 - 08:50 AM

#1 Misfit  Icon User is offline

  • D.I.C Head

Reputation: 9
  • View blog
  • Posts: 100
  • Joined: 18-July 09

mod_rewrite issues

Posted 03 January 2013 - 08:50 AM

I have a link that looks like:

http://mywebsite.com/?view=yogurt&display=peach

# OR (and it currently does this)

http://www.mywebsite.com/?view=yogurt&display=peach



------------------

I want the url to look like the following, and if the query string is hit, I would like it to redirect to this sort of url:

http://mywebsite.com/yogurt/peach
OR
http://www.mywebsite.com/yogurt/peach




------------------

The values in 'view' and 'display' may be anything, and any query string after it may be interpreted literally, like this:

http://mywebsite.com/yogurt/peach/?type=greek



I would only like these rules to activate if the link begins with those query strings. This is to enforce that links such as /style/stylesheet.css keep their MIME type. Here's the only bit I've hacked together, all other attempts (for hours now) have failed.

# note: I don't want /app in the beginning. It's only there so the MIME types of other files are enforced.
RewriteRule ^app/([^/]+)/([^/]+)/? /?view=$1&display=$2 [QSA]


This post has been edited by Misfit: 03 January 2013 - 11:01 AM


Is This A Good Question/Topic? 0
  • +

Page 1 of 1