2011-12-22 6 views
0

私のlocalhostで.htaccess設定をテストしています。
ウェブサイトのルートは、http://localhost/test/localhostを使用したURL書き換えが動作しません。

私の.htaccessは次のとおりです。

Options +FollowSymlinks 
RewriteEngine on 
RewriteCond %{REQUEST_URI} !^/test/index2.php 
RewriteRule ^test/(.*)$ /test/index2.php?dest=$1 [L] 

私はindex2.phpするhttp://localhost/test/で始まるすべてのコールをリダイレクトするために達成することはできません。
その.htaccessを使用して、電話するhttp://localhost/test/index.php
「このサーバーでは、要求されたURL /test/index.phpが見つかりませんでした」という404エラーが見つかりました。

私はそれが http://localhost/test/index2.php?index.php

TIP呼び出すために待っていた

:のRewriteCondを削除すると何も

PSは変更されません:URL書き換えが有効になっているとsimplier例のために働く

答えて

0

多分あなたはのmod_rewriteを有効にしていません modul。前に#看板

LoadModule rewrite_module modules/mod_rewrite.so 

せずに必ずこの行を作成し、このように、このラインAppServ\apache\conf\httpd.conf

<Directory "C:/AppServ/www/cgi-bin"> 
    AllowOverride None 
    Options None 
    Order allow,deny 
    Allow from all 
</Directory> 
+0

は、それがONだと他の作品でそれを確認するために

試してみますケース – Oliver

+0

このようにお試しください: オプション+ FollowSymlinks RewriteEngine on DirectoryIndex index2.php – Fredy