htaccess Rediect loop

Discussion in 'Apache' started by maxzeroedge, Jan 25, 2014.

  1. #1
    Well, I was trying to use the following in htaccess, but I get the message of redirect loop.
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?page=$1 [L,QSA]

    What I want to do is this:
    • The URL is like somedomain.sub.com/somepage/s1/s2
    • The index.php is accessible from somedomain.sub.com/somepage/
    • I want to send s1/s2 as $_GET['page']
    • Also, I don't want the URL in the address bar to change, only the url sent to the server should change.
    This worked well in my localhost, but on webserver (0fees.net), it doesn't work
     
    maxzeroedge, Jan 25, 2014 IP
  2. ElizabethKonig

    ElizabethKonig Active Member

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    71
    #2
    I think that if you request somedomain.sub.com/somepage/s1/s2 this rewrite will return somedomain.sub.com/index.php?page=/somepage/s1/s2 is this what you want?
     
    ElizabethKonig, Feb 19, 2014 IP