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.

Mod Rewrite

Discussion in 'Programming' started by mystikmedia, Feb 27, 2009.

  1. #1
    mystikmedia, Feb 27, 2009 IP
  2. mwasif

    mwasif Active Member

    Messages:
    816
    Likes Received:
    23
    Best Answers:
    1
    Trophy Points:
    70
    #2
    Try this one in "folder"

    RewriteEngine on
    RewriteRule ^index\.php$ http://www.example.com/folder/ [R=301,L]
    
    RewriteCond %{http_host} ^example\.com [NC]
    RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,NC,L]
    Code (markup):
     
    mwasif, Feb 28, 2009 IP
  3. mystikmedia

    mystikmedia Jedi Master

    Messages:
    5,564
    Likes Received:
    498
    Best Answers:
    0
    Trophy Points:
    270
    #3
    mystikmedia, Feb 28, 2009 IP
  4. mwasif

    mwasif Active Member

    Messages:
    816
    Likes Received:
    23
    Best Answers:
    1
    Trophy Points:
    70
    #4
    Use the following for 2nd condition

    RewriteCond %{http_host} !^www\.example\.com$ [NC]
    RewriteRule ^(.*)$ http://www.example.com/folder/$1 [R=301,NC,L]
    Code (markup):
     
    mwasif, Mar 1, 2009 IP
  5. mystikmedia

    mystikmedia Jedi Master

    Messages:
    5,564
    Likes Received:
    498
    Best Answers:
    0
    Trophy Points:
    270
    #5
    Terrific. Thanks much. :)
     
    mystikmedia, Mar 1, 2009 IP
  6. mwasif

    mwasif Active Member

    Messages:
    816
    Likes Received:
    23
    Best Answers:
    1
    Trophy Points:
    70
    #6
    You are welcome!
     
    mwasif, Mar 1, 2009 IP