.htaccessファイルを使用して自分のIPアドレスを自分のドメイン名にリダイレクトしようとしていますが、動作していないようです。それと一緒にhttpサイトにもhttpsリンクをリダイレクトしたいと思います。誰も助けることができます。IPアドレスが共有ホストの.htaccessを使用してドメイン名にリダイレクトする
私の.htaccessファイルは、あなたが共有ホスティング上でこれを行うことはできません。この
Options -Indexes
ErrorDocument 404 /404.php
ErrorDocument 403/
<FilesMatch "\.inc.php">
order deny,allow
deny from all
</FilesMatch>
## SEO Friendly URLs ##
RewriteEngine On
RewriteCond %{HTTP_HOST} ^111\.11\.111\.11$
RewriteRule (.*) http://www.domainname.com/$1 [R=301,L]
RewriteRule ^(admin)($|/) - [L]
## hide .php extension
# To externally redirect /dir/foo.php to /dir/foo
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.php [NC]
RewriteRule^%1 [R,L,NC]
## To internally redirect /dir/foo to /dir/foo.php
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule^%{REQUEST_URI}.php [L]
RewriteCond %{HTTP_USER_AGENT} libwww-perl.*
RewriteRule .* ? [F,L]
<IfModule mod_expires.c>
ExpiresActive on
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
</IfModule>