Mod-書き直載荷ファイルの裏にはDocumentRoot
-
08-06-2019 - |
質問
を使用してい .htaccess
や mod_rewrite
ポートファイルを背景にエラ.私のフォルダ構成は以下のようなものです:
home/
webroot/
other_files/
してい .htaccess
ファイルwebrootウェブルートは以下の内容:
RewriteEngine on RewriteRule ^(.*)$ /home/other_files/$1
いうアクセス http://example.com/file.html って請求金額は異なります。エラー:
要求されたURL/home/other_files/file.html 見つかりませんでしたがこのサーバーです。
でも可能なファイルを読み込んだときつまみその背景にはDocumentRoot?その場合、できる人もの方向になっていますか?
解決
ダウンロードいただけまを追加する必要があり部
<Directory "/home/other_files">
(options)
</Directory>
ごサーバの設定の前にapacheがないからです。例えば、私のDocumentRootでは/var/wwwものがありここではデフォルトの有サイト:
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
がこれに書き換えURLへ/doc/およびサーバーが知らないが、ファイルです。
他のヒント
うなぜこのルールな作品:
その理由なので書き換える /home/other\_files/file.html
は、mod_rewriteは解析に用としてpath /home/webroot/home/other\_files/file.html
さらにmod_rewriteの前にスラッシュはequivelantドル /home/webroot
.
ライアンアハーンの提案 でも、やるのルートです。
の信用をライアンAheamが、私のスペルです。私は初心者にとってもライアンの回答があったので実験をいくつかの書式です。
いと思ってエラーとなるcakephpをクリックします。そのたカマキリバグトラッカーだった通常のphpなどのcakephpをクリックします。は、以下のファイルに以下の作業。
http://www.my_website.com :り/var/www/cakephp
http://www.my_website.com/mantisbt :り/var/www/html/mantisbt
ファイル/etc/httpd/conf/httpd.conf
Alias /mantisbt/ "/var/www/html/mantisbt/"
<Directory "/var/www/html/">
AllowOverride All
</Directory>
<VirtualHost *:80>
ServerAdmin me@my_email.com
DocumentRoot /var/www/cakephp
ServerName my_website.com
<Directory /var/www/cakephp/>
AllowOverride All
</Directory>
</VirtualHost>
ファイルを/var/www/cakephp/.htaccess
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^mantisbt/?$ /mantisbt/ [NC,L]
RewriteRule ^$ webroot/ [L]
RewriteRule (.*) webroot/$1 [L]
</IfModule>