2016-11-04 13 views
1

後にスラッシュ私は.htaccessファイル次き:のhtaccessモッズ書き換えやindex.phpの

RewriteEngine on 
RewriteBase /
RewriteCond $1 !^(index\.php|images|css|js|robots\.txt|favicon\.ico) 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ ./index.php/$1 [L,QSA] 

をおそらく理由は、バージョン2.4.23へのapacheの更新のこの1は動作を停止し、ブラウザがメッセージfile not foundを返します。

私は

example.com/auth/login

検索index.php{document_root}/auth/login下のディレクトリに対する直接ではなく{document_root}で、したがって、それは働いていない、そのURLを見つけました。直接%{DOCUMENT_ROOR}変数をindex.phpの前に置くと、Apache rootがURLから取得したものであるとApacheのように思えます。

index.phpの後にパス全体を入れてindex.phpに書き直すにはどうすればよいですか?

EDIT は私がFCGIを使用していますし、これは私のバーチャルホストファイルです:あなたはこのルールを使用することができます

<Directory "/Users/pogo/Development/www"> 
    Options Indexes FollowSymLinks MultiViews 
    AllowOverride All 
    Order allow,deny 
    Allow from all 
    Require all granted 
</Directory> 

<VirtualHost *:8080> 
    ServerName dh 
    ServerAlias *.dh 

    VirtualDocumentRoot "/Users/pogo/Development/www/%-2.0.%-1/%0/www" 
    DirectoryIndex index.html index.php 
    RewriteEngine On 

    <FilesMatch \.php$> 
     SetHandler "proxy:unix:/usr/local/var/run/php5/php5-fpm.sock|fcgi://localhost" 
    </FilesMatch> 
</VirtualHost> 
+0

はどこhtaccessファイルを指定しますです。 – Deadooshka

+0

@Deadooshkaを直接ドキュメントルート –

答えて

0

AcceptPathInfo On 
Options +FollowSymLinks 
RewriteEngine on 

RewriteCond $1 !^(index\.php|images|css|js|robots\.txt|favicon\.ico) [NC] 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ /index.php/$1 [L,QSA] 

お知らせ/index.php代わり./index.phpのを

+0

ありがとう、残念ながら、私は同じ結果を得ました –

+0

いいえ、.htaccessでちょうどこれです。私は自分の質問を編集し、私のapache vhostの設定を投稿しました。 –

+0

あなたの '.htaccess'が有効になっているかどうかを確認するには、あなたの' .htaccess'の上に何らかのゴミ(ランダム)のテキストを置き、あなたのページをブラウザで訪れたときに500(内部サーバ) 500エラーは.htaccessが有効であることを意味します。 – anubhava