Results 1 to 5 of 5

Thread: mod_rewrite.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Life tester Tuborgman's Avatar
    Join Date: Sep:2006
    Location: Sofia
    Posts: 27

    mod_rewrite.

    ,

    , , . , . request / /index.php, /index.php?main=index, info.php /index.php?main=info. 9, , :

    Code:
    RewriteEngine On
    RewriteCond %{QUERY_STRING} !^$
    RewriteCond %{QUERY_STRING} !^main=index$
    RewriteCond %{QUERY_STRING} !^main=info$
    RewriteRule . - [F]
    RewriteCond %{QUERY_STRING} ^$
    RewriteRule ^/index\.php$ http://my.domain/index.php?main=index [L]
    RewriteCond %{QUERY_STRING} ^$
    RewriteCond %{QUERY_STRING} ^main=info$
    RewriteRule ^/index\.php$ info.php
    , , -generalized, ( URL /):
    Code:
    RewriteCond %{QUERY_STRING} ^main=(.*)$
    RewriteRule index\.php %1.php
    , , , /info.php , /index.php?main=info index.php. /index.php?main=info info.php.

    , .
    Last edited by Tuborgman; 19th February 2008 at 20:30.
    "24 hours in a day...24 beers in a case...coincidence?"

  2. #2
    Registered User
    Join Date: Aug:2006
    Location: Sofia
    Posts: 37
    , :

    RewriteEngine On
    RewriteRule ^$ index.php?main=index [L]
    RewriteCond $1 !^info\.php
    RewriteRule ^(info)\.php index.php?main=$1 [L]
    RewriteCond %{QUERY_STRING} ^$
    RewriteRule ^(index)\.php$ index.php?main=$1 [L]

  3. #3
    Life tester Tuborgman's Avatar
    Join Date: Sep:2006
    Location: Sofia
    Posts: 27
    Quote Originally Posted by sunless View Post
    , :

    RewriteEngine On
    RewriteRule ^$ index.php?main=index [L]
    ****RewriteCond $1 !^info\.php
    ****RewriteRule ^(info)\.php index.php?main=$1 [L]
    RewriteCond %{QUERY_STRING} ^$
    RewriteRule ^(index)\.php$ index.php?main=$1 [L]
    , . , :

    Code:
    RewriteCond $1 !^info\.php
    RewriteRule ^(info)\.php index.php?main=$1 [L]
    /index.php?main=info /index.php. , /info.php .
    "24 hours in a day...24 beers in a case...coincidence?"

  4. #4
    Registered User iMarh's Avatar
    Join Date: May:2002
    Location:
    Posts: 373
    Code:
    RewriteEngine on
    RewriteRule ^index.php?$ index.php?main=index [L,NC]
    RewriteRule ^info.php?$ index.php?main=info [L,NC]

  5. #5
    Registered User
    Join Date: Jan:2004
    Posts: 50
    Code:
    RewriteRule ^(index|info).php$ index.php?main=$1

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Copyright © 1999-2011 . .
iskamPC.com | mobility.BG | Bloody's Techblog | | 3D Vision Blog |