2

たとえば、SEO に適した URL を生成するために .htaccess も使用している Joomla-Web サイトを実行しています。アップグレードのため、最初のステップで Web サイトを xampp にインポートしたいと考えています。これは、ウェルカム ページでは問題なく機能します。しかし、メニューからリンクを選択すると、常に「オブジェクトが見つかりません」というエラーが表示されます。これは .htaccess ファイルが原因です。www.mypage.com から localhost/mypage に変更する必要があります。

通常の Web サイトの .htaccess は次のようになります。

RewriteEngine on

RewriteCond %{HTTP_HOST} !^www\.mypage\.de$
RewriteRule ^(.*)$ http://www.mypage.de/$1 [L,R=301]

########## Begin - Rewrite rules to block out some common exploits
RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
RewriteRule ^(.*)$ index.php [F,L]

#  Uncomment following line if your webserver's URL
#  is not directly related to physical file paths.
#  Update Your Joomla! Directory (just / for root)

RewriteBase /

########## Begin - Joomla! core SEF Section
#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/index.php
RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$  [NC]
RewriteRule (.*) index.php
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
#
########## End - Joomla! core SEF Section

www.mypage.de の代わりに localhost/mypage で動作するように、これを変更する必要があります。私は .htaccess に詳しくないので、誰かがエラーの原因とここで何を変更する必要があるかを教えてくれると助かります。

ありがとう :)

4

1 に答える 1

0

私はそれがどのように機能するかを知りました:

RewriteEngine on

########## Begin - Rewrite rules to block out some common exploits
RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
RewriteRule ^(.*)$ index.php [F,L]

#  Uncomment following line if your webserver's URL
#  is not directly related to physical file paths.
#  Update Your Joomla! Directory (just / for root)

RewriteBase /mypage

########## Begin - Joomla! core SEF Section
#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/index.php
RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$  [NC]
RewriteRule (.*) index.php
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
#
########## End - Joomla! core SEF Section

重要なことは、RewriteBase を /mypage に変更することです。

それに加えて、次の部分を削除しました。

RewriteCond %{HTTP_HOST} !^www\.mypage\.de$
RewriteRule ^(.*)$ http://www.mypage.de/$1 [L,R=301]

Web 上の生産的な Web サイトにのみ適用されるためです。

于 2013-01-25T15:52:35.183 に答える