need help with htacess rewrite rule

Discussion in 'Apache' started by vn412, Dec 29, 2011.

  1. #1
    Hi,

    I want to rewrite the following url:
    http://www.mydomain.com/classifieds/index.php?newjersy

    to

    http://www.mydomain.com/newjersy/classifieds/

    so that url that is visible to users will the second one but
    it loads the page of the first url i specified.

    Please help me.
    Thanks in advance
     
    vn412, Dec 29, 2011 IP
  2. PISG

    PISG Member

    Messages:
    16
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    31
    #2
    http://www.mydomain.com/classifieds/index.php?newjersy is this correct url?
     
    PISG, Dec 29, 2011 IP
  3. vn412

    vn412 Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    yes???? I did not get you
     
    vn412, Dec 29, 2011 IP
  4. CLMMafia

    CLMMafia Member

    Messages:
    93
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    28
    #4
    RewriteEngine On
    RewriteBase /
    RewriteRule ^([a-z-A-Z-0-9-_]+)/classifieds/?$ classifieds/index.php?$1 [L]

    sould work but i haven't tested it...
     
    CLMMafia, Dec 29, 2011 IP
  5. vn412

    vn412 Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Thanks for reply.
    Is there anyway I can write a single rewrite rule for all the pages in classifieds folder.
    e.g
    http://www.mydomain.com/abc/classifieds/showall.php
    http://www.mydomain.com/abc/classifieds/search.php

    Thanks
     
    vn412, Dec 30, 2011 IP