0

私はこの問題に数晩取り組んできましたが、うまくいきませんでした。(.htaccess) を使用して、cobweb.seas.gwu.edu/~mpnl から: cobweb.seas.gwu.edu/~mpnl/joomla への Web 要求を書き換えようとしています。

私の最新の(.htaccess)ファイルは以下の通りです:

# turn on Rewrite
RewriteEngine on

RewriteCond %{HTTP_HOST} ^(www.)?cobweb.seas.gwu.edu/~mpnl$
RewriteCond %{REQUEST_URI} !^/joomla/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /joomla/$1 [L]

RewriteRule ^(/)?$ joomla/index.php [L]
4

2 に答える 2

0

%{HTTP_HOST} 変数で URI パスと照合することはできません。ホストのみです。~mpnlこの部分を書き換えベースとして、またはリクエスト URI の一部として含める必要があります。

RewriteEngine on

# remove the "/~mpnl" from the end of this line, add a [NC]
RewriteCond %{HTTP_HOST} ^(www.)?cobweb.seas.gwu.edu$ [NC]
# add a "/~mpnl" to here
RewriteCond %{REQUEST_URI} !^/~mpnl/joomla/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# remove the leading slash before "joomla"
RewriteRule ^(.*)$ joomla/$1 [L]

# add a condition to this:
RewriteCond %{REQUEST_URI} !^/~mpnl/joomla/
RewriteRule ^(/)?$ joomla/index.php [L]
于 2012-08-24T19:00:43.670 に答える