URL Rewrite help.

Discussion in 'PHP' started by vladl, Jun 7, 2012.

  1. #1
    vladl, Jun 7, 2012 IP
  2. NetStar

    NetStar Notable Member

    Messages:
    2,471
    Likes Received:
    541
    Best Answers:
    21
    Trophy Points:
    245
    #2
    I *believe* with mod_alias: Alias /contactus /path/to/index.php?app=contactus

    -OR- the "preferred" mod_rewrite:

    RewriteEngine On
    RewriteRule ^contactus$ index.php?app=contactus
     
    NetStar, Jun 8, 2012 IP
  3. vladl

    vladl Peon

    Messages:
    115
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    heres my whole .htaccess were should i put it :/

    <IfModule mod_rewrite.c>
    Options -MultiViews
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} .*\.(jpeg|jpg|gif|png)$
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule . /public/404.php [L]


    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
     
    vladl, Jun 8, 2012 IP
  4. vladl

    vladl Peon

    Messages:
    115
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Stop spamming,
     
    vladl, Jun 8, 2012 IP
  5. NetStar

    NetStar Notable Member

    Messages:
    2,471
    Likes Received:
    541
    Best Answers:
    21
    Trophy Points:
    245
    #5
    Looks like you are routing all requests to a PHP script... Is this correct?

    I would add RewriteRule ^contactus$ index.php?app=contactus [L] above last set and try it.
     
    NetStar, Jun 8, 2012 IP
  6. vladl

    vladl Peon

    Messages:
    115
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    ok so post what i should make my htacess :D
     
    vladl, Jun 8, 2012 IP
  7. NetStar

    NetStar Notable Member

    Messages:
    2,471
    Likes Received:
    541
    Best Answers:
    21
    Trophy Points:
    245
    #7
    I told you.
     
    NetStar, Jun 8, 2012 IP