Need someone good with htacces

Discussion in 'Programming' started by Scoding, Jan 3, 2011.

  1. #1
    5min job, what I currently have is

    Options +FollowSymlinks
    RewriteEngine On
    RewriteRule ^([A-Za-z]+)$ index.php?page=$1 [QSA]
    Code (markup):
    if you visit website.com/test

    it will load

    index.php?page=test

    if you load website.com/css/style.css it will load the actual file,

    now what I need is to make it so when person loads

    website.com/page/subpage

    it will request that page through index.php?page=page/subpage

    and still load the css files within server


    easy 5-10$,

    Pm me
     
    Scoding, Jan 3, 2011 IP
  2. gapz101

    gapz101 Well-Known Member

    Messages:
    524
    Likes Received:
    8
    Best Answers:
    2
    Trophy Points:
    150
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #2
    try this:
    
    Options +FollowSymlinks
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.+)/(.*)$ index.php?page=$1/$2  [NC,L,QSA]
    RewriteRule ^(.*)$ index.php?page=$1 [L,QSA]
    
    Code (markup):
     
    gapz101, Jan 4, 2011 IP
    Scoding likes this.
  3. kp_mastermind

    kp_mastermind Active Member

    Messages:
    885
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    58
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #3
    Options +FollowSymlinks
    RewriteEngine On
    RewriteRule ^([A-Za-z]+)$ index.php?page=$1 [QSA]
    RewriteRule ^([A-Za-z]+)$/([A-Za-z]+)$ index.php?page=$1/$2 [QSA]
     
    kp_mastermind, Jan 4, 2011 IP
    Scoding likes this.
  4. MyVodaFone

    MyVodaFone Well-Known Member

    Messages:
    1,048
    Likes Received:
    42
    Best Answers:
    10
    Trophy Points:
    195
    As Seller:
    100% - 1
    As Buyer:
    100% - 1
    #4
    On a side note add
    RewriteBase /
    Code (markup):
    ...just after RewriteEngine On
     
    MyVodaFone, Jan 4, 2011 IP
    Scoding likes this.
  5. Scoding

    Scoding Well-Known Member

    Messages:
    1,091
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    155
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #5
    thanks guys, got that done before any of your replies :)
     
    Scoding, Jan 16, 2011 IP
  6. BreezeTR

    BreezeTR Well-Known Member

    Messages:
    115
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    105
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #6
    How did ?
     
    BreezeTR, Jan 16, 2011 IP