Results 1 to 13 of 13

Thread: MOD_REWRITE

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    White awesomeness z0ne's Avatar
    Join Date: Feb:2002
    Location: o
    Posts: 13,331

    MOD_REWRITE

    , .htaccess-a.

    :

    Code:
    index.php?page=1&varId=1&varId2=2&varId3=3&varIdN=N
    =

    Code:
    /page/1/varId/1/varId2/2/varId3/3/.../varIdN/N

    .htacces &page - .. , . - - .htaccess , "?" "&". .

    .

  2. #2
    دارس وعامل Siemens's Avatar
    Join Date: Jul:2003
    Location:
    Posts: 1,576
    :
    Code:
    RewriteCond %{REQUEST_FILENAME} !-s
    #  /a/1/b/2/index.html
    RewriteRule ^(.*)/(.*)(\.html)$ $2.php/$1 [L]
    
    RewriteCond %{REQUEST_FILENAME} !-s
    #  /index.html
    RewriteRule ^(.*)(\.html)$ $1.php [L]
    
    
    RewriteCond %{REQUEST_FILENAME} !-s
    #     (.. /a/b/v/index.html)
    #  ,          php  (   )
    RewriteRule ^(.*)/$ index.php/$1 [L]
    ..
    domain.com/var1/val1/var2/val2/index.html
    ,
    index.php?var1=val1&var2=val2
    index.html default.html default.php

    ... .

  3. #3
    White awesomeness z0ne's Avatar
    Join Date: Feb:2002
    Location: o
    Posts: 13,331
    ! site.com/a/1/b/2/c/3 /index.* ? ?

  4. #4
    دارس وعامل Siemens's Avatar
    Join Date: Jul:2003
    Location:
    Posts: 1,576
    " " . index.php ( apache), / . , debug.php ( URL domain.com/var1/val1/debug.html - debug.php?var1=val1)
    .. .

    ..
    :

    domain.com/realdir1/realdir2/index.php/var1/val1/

    domain.com/realdir1/realdir2/index.php?var1=val1
    realdir1/realdir2/ index.php , apache (realdir1/realdir2/index.php/var1/ ..)

  5. #5
    White awesomeness z0ne's Avatar
    Join Date: Feb:2002
    Location: o
    Posts: 13,331
    ... . .. :

    index.php?alert=

    => site.com/alert/ , .

    .htaccess

    Code:
    Options +FollowSymLinks
    
    RewriteEngine on
    
    RewriteBase /
    
    DirectoryIndex index.php
    
    RewriteCond %{REQUEST_FILENAME} !-s
    
    RewriteRule ^(.*)/$ index.php/$1 [L]

  6. #6
    Registered User
    Join Date: Jul:2005
    Location: Sofiq
    Posts: 2,798
    Code:
    Options +FollowSymLinks
    
    RewriteEngine on
    
    RewriteBase /
    
    DirectoryIndex index.php
    
    RewriteCond %{REQUEST_FILENAME} !-s
    
    RewriteRule ^(.*)/$ controller.php?request=$1&%{QUERY_STRING} [L]
    http://domain.com/alabal/page/1/?proba=2
    request /alabal/page/1 . controler.php request .

  7. #7
    White awesomeness z0ne's Avatar
    Join Date: Feb:2002
    Location: o
    Posts: 13,331
    .

  8. #8
    دارس وعامل Siemens's Avatar
    Join Date: Jul:2003
    Location:
    Posts: 1,576
    .htaccess .


    domain.com/index.php/var1/val1/

    .. index.php

    index.php ( index.html ).

  9. #9
    Registered User
    Join Date: Jul:2005
    Location: Sofiq
    Posts: 2,798


    Code:
    RewriteRule ^(.*)/$ controller.php?request=$1&%{QUERY_STRING} [L]


    Code:
    RewriteRule ^(.*)/$ /controller.php?request=$1&%{QUERY_STRING} [L]
    . / php .

    print_r($_GET);
    Code:
    Array ( [request] => dgdgdfg/sdfgsdg )

  10. #10
    White awesomeness z0ne's Avatar
    Join Date: Feb:2002
    Location: o
    Posts: 13,331
    Quote Originally Posted by _ShadoW_ View Post
    Code:
    Array ( [request] => dgdgdfg/sdfgsdg )
    , / = & ?. "request" "/", a , . , :

    : hardwarebg.com/forum/memberlist.php?&order=asc&sort=username& page=2

    : hardwarebg.com/forum/order/asc/sort/username/page/2

    , page order - ..

    hardwarebg.com/forum/sort/username

    3-4 .

    ?

  11. #11
    Registered User
    Join Date: Jul:2005
    Location: Sofiq
    Posts: 2,798
    Quote Originally Posted by z0ne View Post
    , / = & ?. "request" "/", a , . , :

    : hardwarebg.com/forum/memberlist.php?&order=asc&sort=username& page=2

    : hardwarebg.com/forum/order/asc/sort/username/page/2

    , page order - ..

    hardwarebg.com/forum/sort/username

    3-4 .

    ?
    . request = 'order/asc/sort/username/page/2'; php explode("/", $_GET['request']) . , mod_rewrite . .

  12. #12
    Banned
    Join Date: Oct:2001
    Location: , -5
    Posts: 2,637
    , . , , GET . , rewrite , , , , , . , , . , 301 Redirect. - , , , .

    - .

  13. #13
    White awesomeness z0ne's Avatar
    Join Date: Feb:2002
    Location: o
    Posts: 13,331
    . .

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 |