2011-02-04 12 views
0

に私は例えばメイン 内のフォルダで仕事をいくつかrewriterules持っていない:メインフォルダである/ を私はこれがあるhtaccessの内部/は、ルールを書き換える.htaccessのサブフォルダに動作しますが、メイン

を置きます。 htaccess

Options +FollowSymlinks 
RewriteBase/
RewriteEngine On 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{REQUEST_FILENAME}\.php -f 
RewriteRule ^about/(.*)/$ $1.php [L] 
RewriteRule ^(.*)/download/(.*)/(.*)/(.*)/$ download-donate.php?product=$1&version=$2&os=$3&method=$4 [L] 
RewriteRule ^(.*)/download/(.*)/$ download.php?product=$1&version=$2 [L] 
RewriteRule ^subscribe/(.*)/$ subscribe-$1.php [L] 
RewriteRule ^subscribe/(.*)/(.*)/$ subscribe-$1.php?email=$2 [L] 
RewriteRule ^(.*)/screenshots/$ screenshots.php?product=$1 [L] 
RewriteRule ^(.*)/(.*)/$ products.php?product=$1&page=$2 [L] 
RewriteRule ^schedule-manager/$ products.php?product=schedule-manager&page=view [L] 
RewriteRule ^visual-command-line/$ products.php?product=visual-command-line&page=view [L] 
RewriteRule ^windows-hider/$ products.php?product=windows-hider&page=view [L] 
RewriteRule ^(.*)/$ $1.php [L] 

メインフォルダでは機能しません。 同じhtaccess(RewriteBaseを/ test /に変更)し、 "test">/test /という名前のフォルダ内に置くと、perefectlyで動作します。

おかげで、この2つのパラメータの順序を変更する

+0

Options -MultiViews 

を追加.com/test/something ..適切な答えではありませんが、他のオプションが不足していると、あなたのために働くことができます。 – yoda

+0

問題は次のとおりです - サブフォルダDID WORK <<メインフォルダDID NOT WORK .. – Ron

答えて

2

ホスティング会社がGoDaddyのであれば、あなたはすべて.COMを指している/何かが書き換え中られる方法でそれをハック可能性が

Options +FollowSymlinks 
+0

から1つの変更で同じコードを持っていました。ありがとうございます!出来た!!!! – Ron

0

試してみてください。

RewriteEngine On 
RewriteBase/

それは何をするだろうが、それはこの方法がより理にかなっていないことを確認。

編集

これは、あなたが/テスト/フォルダの上にコードを前提としています。

Options +FollowSymlinks 
RewriteEngine On 
RewriteBase/
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{REQUEST_FILENAME}\.php -f 
RewriteRule ^about/(.*)/$ test/$1.php [L] 
RewriteRule ^(.*)/download/(.*)/(.*)/(.*)/$ test/download-donate.php?product=$1&version=$2&os=$3&method=$4 [L] 
RewriteRule ^(.*)/download/(.*)/$ test/download.php?product=$1&version=$2 [L] 
RewriteRule ^subscribe/(.*)/$ test/subscribe-$1.php [L] 
RewriteRule ^subscribe/(.*)/(.*)/$ test/subscribe-$1.php?email=$2 [L] 
RewriteRule ^(.*)/screenshots/$ test/screenshots.php?product=$1 [L] 
RewriteRule ^(.*)/(.*)/$ test/products.php?product=$1&page=$2 [L] 
RewriteRule ^schedule-manager/$ test/products.php?product=schedule-manager&page=view [L] 
RewriteRule ^visual-command-line/$ test/products.php?product=visual-command-line&page=view [L] 
RewriteRule ^windows-hider/$ test/products.php?product=windows-hider&page=view [L] 
RewriteRule ^(.*)/$ test/$1.php [L] 
+0

これまでに試してみました。 didnt仕事。私の注文ではサブフォルダで働いたので、注文を変更する理由はありません – Ron

+0

私が更新したコードを試してみてください。 – yoda

+1

dinbrcaが答えをくれました!とにかく、私は/ test /にRewriteBase/RewriteBase/test/ – Ron

関連する問題