0

誰でも上記のリンクを書き直すのを手伝ってくれます。カスタムスクリプトを作成しましたが、これを書き直すのに問題があります。次のようなものでhtaccessを開始します...

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^([^/]*)$ /index.php?page=$1 [L]
RewriteRule ^([^/]*)$ /index.php?query=$1 [L]
RewriteRule ^([^/]*)/([^/]*)$ /index.php?query=$1&page=$2 [L]

しかし、これは機能しません、私はサーバーエラー500を持っています...

これは私が書き直す必要があるものです。

http://site.com/index.php?page=1 ==> http://site.com/1
http://site.com/index.php?type=news&page=1 ==> http://site.com/news/1
http://site.com/index.php?query=searching ==> http://site.com/searching 
http://site.com/index.php?query=searching&page=1  ==> http://site.com/searching/1
4

1 に答える 1

0

これらを試してください-私はあなたが前に戻ってルールを持っていると思います:

http://site.com/1はhttp://site.com/index.php?page=1を実行します

RewriteRule ^([0-9]+) /index.php?page=$1 [L]

http://site.com/news/1はhttp://site.com/index.php?type=news&page=1を実行します

RewriteRule ^news/([0-9]+) /index.php?type=news&page=$1 [L]

http://site.com/searchingはhttp://site.com/index.php?query=searchingを実行します

RewriteRule ^searching/?$ /index.php?query=searching [L]

http://site.com/searching/1はhttp://site.com/index.php?query=searching&page=1を実行します

RewriteRule ^searching/([0-9]+)$ /index.php?query=searching&page=$1 [L]
于 2012-05-20T07:00:36.777 に答える