2017-11-13 10 views
0

htaccessルールに問題があります。動作していないためです。私はすでにGoogle上の任意のソリューションを見つけることを試みるがまだまだ見つけられていない。 コードは次のとおりです。.htaccess複数のパラメータが動作していない[sloved]

RewriteEngine ON 
RewriteBase /deshop/ 
RewriteCond %{REQUEST_URI} ^/deshop/admin(.+)$ 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.+)$ admin/index.php [L,QSA] 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^([^/]*)$ index.php?p=$1 [L] 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^([^/]*)/([^\s]+)$ index.php?p=$1&b=$2 [L] 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^([^/]*)/([0-9]+)$ index.php?p=$1&id=$2 [L] 

URLが正常に動作している:

http://localhost/deshop/index.php to http://localhost/deshop/ -> home page from folder 
http://localhost/deshop/admin/index.php to http://localhost/deshop/admin/ -> admin page from subfolder 
http://localhost/deshop/index.php?p=tshirts to http://localhost/deshop/tshirts/ 
http://localhost/deshop/index.php?p=brand&b=John%20Player to http://localhost/deshop/brand/John-Player/ 

だから起こり、最後のルールが動作しません。

RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^([^/]*)/([0-9]+)$ index.php?p=$1&id=$2 [L] 

しかし最後のルールはまだ機能していません。私は本当に難しい。私はパラメータでURLを取得したいので、作品を見て:

http://localhost/deshop/index.php?p=single&id=0005 to http://localhost/deshop/single/0005 

それとも、私が間違って何ですか?どんな解決策ですか?手伝って頂けますか?どうもありがとう。ところで、私の英語は良くありません。ごめんなさい!

答えて

0

最後に私はそれを解決しました。

RewriteEngine ON 

RewriteCond %{REQUEST_URI} ^/miistore/miiadmin$ 
RewriteRule ^(.+)$ miiadmin/index.php [L,QSA] 

RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^([^/]+)/?$ index.php?p=$1 [L,QSA] 

RewriteRule ^/?single/([^/d]+)/?$ index.php?p=single&id=$1 [L,QSA] 
RewriteRule ^/?brand/([^\s]+)/?$ index.php?p=brand&b=$1 [L,QSA] 
関連する問題