サブディレクトリに Magento をインストールしました。Magento へのパスは「public_html/magento」です。正当な理由により、Magento のインストールをルートから遠ざける必要があります。
次のように、ルート 'public_html' に .htaccess ファイルがあります。
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{http_host} ^alisonclairenaturalbeauty.com [NC]
RewriteRule ^(.*)$ http://www.alisonclairenaturalbeauty.com/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^(www\.)?alisonclairenaturalbeauty\.com$ [NC]
RewriteCond %{REQUEST_URI} !^/magento(/.*)?$ [NC]
RewriteRule ^(.*)$ /magento/$1 [QSA,L]
「public_html/magento」の標準の Magento .htaccess では、次のように RewriteBase ディレクティブのコメントを外しました。
RewriteBase /magento/
Magento 構成では、安全でない URL は「http://www.alisonclairenaturalbeauty.com/」であり、安全な URL は「https://www.alisonclairenaturalbeauty.com/」です。
私の目的は 2 つあります。
「http://www.alisonclairenaturalbeauty.com/magento/」が「http://www.alisonclairenaturalbeauty.com」としてブラウザーに表示されるように、URL からサブディレクトリ名を削除したいと考えています。
URL を重複させたくないので、「実際の」URL「http://www.alisonclairenaturalbeauty.com/magento/ 」は「http://www.alisonclairenaturalbeauty.com/」と表示する必要があります。
最初の目的は達成しましたが、2 番目の目的は達成できませんでした。残念ながら、私のウェブサイトのページには、「http://www.alisonclairenaturalbeauty.com/skin-care/hand-creams.html」と「http://www.alisonclairenaturalbeauty.com/magento/skin-care/hand」の両方からアクセスできます。 -creams.html'.
「http://www.alisonclairenaturalbeauty.com/magento/skin-care/hand-creams.html」を「http://www.alisonclairenaturalbeauty.com/skin-care/hand-creams.html」に書き換えてほしい.
私はSOの投稿とGoogleで見つけた投稿を調べましたが、役に立たなかったので、どんな助けも大歓迎です。