0

原文 = http://ritetag.techreanimate.com/signin.php?network=twitter&fhfghdfghh=sadfgsdf 重写 = http://ritetag.techreanimate.com/signin/twitter?fhfghdfghh=sadfgsdf

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^signin/([^/]*)$ /signin.php?network=$1

我得到了这个工作,但我无法使用 get 来获得其他变量,我如何让 toe rewrite 为网络以外的东西工作。

4

1 回答 1

0

我解决了!

RewriteBase 上的 RewriteEngine /

    #This rewrite has no L flag so the second one can continue
    #Signin.php can have multiple networks like signin/twitter = signin.php?network=twitter
    RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^signin/([^/]*)$ /signin.php?network=$1 [QSA]

    #this rewrite just allows to use files withouth the .php
    # Like about instead of about.php
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME}.php -f
    RewriteRule ^(.+)$ /$1.php [QSA]

于 2013-07-05T05:18:34.470 回答