1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

.htaccess url rewrite with filter

Discussion in 'Apache' started by L146705, Sep 4, 2012.

  1. #1
    I'm trying to do some custom url rewriting with .htaccess file but I'm getting no luck.

    We have a filter on the manufacturer page and when it changes it adds the category to the end of the url and gets the manufacturer products in that category, our current url looks like this:
    https://www.domain.com/manufacturername?category=72

    I would like the url to look like this:
    https://www.domain.com/manufacturername-categoryname

    I can't seem to figure out why it dosen't work (does a 404 error). Is it possible to do the above? How do you get the variable for category is it just a php get request? My htaccess code is below

    RewriteBase /
    RewriteRule sitemap.xml /index.php?route=feed/google_sitemap
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]
    Code (markup):
     
    L146705, Sep 4, 2012 IP
  2. L146705

    L146705 Peon

    Messages:
    910
    Likes Received:
    27
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I think mod rewrite is easier in this example as we have over 60 urls. Does anyone know how to do this?
     
    L146705, Sep 8, 2012 IP