0
我想重定向我的IP地址到我的域名使用.htaccess文件,但它似乎並沒有工作。除此之外,我還想將我的https鏈接重定向到http站點。任何人都可以幫忙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>