誰かが私のhtaccessコードを見て、明らかに間違っているように見えるものがあるかどうか教えてくれるかどうか疑問に思っていました. 私はこのことについてあまり知りません。また、パーツを別の方法で編成する必要があるかどうか、または「RewriteEngine on RewriteBase /」を複数回配置する必要があるかどうかもわかりませんか? とにかく、ここにコードがあります:
RewriteEngine on
RewriteBase /
RewriteRule ^(.+)\.shtml$ $1.html [R=301,L]
redirect 301 /games.html http://www.slimekids.com/games/
redirect 301 /trailers.html http://www.slimekids.com/book-trailers/
redirect 301 /authors.html http://www.slimekids.com/authors/
redirect 301 /reference.html http://www.slimekids.com/reference/
redirect 301 /reviews.html http://www.slimekids.com/book-reviews/
redirect 301 /searches.html http://www.slimekids.com/search-engines/
RewriteEngine on
RewriteBase /
#if the domain is not www.slimekids.com
RewriteCond %{HTTP_HOST} !^www\.slimekids\.com$ [NC]
#redirect to www.slimekids.com
RewriteRule ^(.*)$ http://www.slimekids.com/$1 [L,R=301]
#leave this rule in place, but after the one above to handle the home page
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.html\ HTTP/
RewriteRule ^index\.html$ http://www.slimekids.com/ [R=301,L]
ErrorDocument 404 /404page.html
## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 2 days"
</IfModule>
## EXPIRES CACHING ##