Я был смело модернизировал свой файл htaccess. однако есть две проблемы, которые я просто не могу исправить. Я попробовал несколько подходов, но для меня ничего не работало.Удалить Двойной трейлинг-косая черта - открыть корзину
- мой сайт: https://www.zeroohm.com/
мои вопросы:
Как я могу удалить дополнительный слэш, когда я иду в zeroohm.com в настоящее время, если я иду в zeroohm.com, он перенаправляет на https://www.zeroohm.com//
Если я перейду на www.zeroohm.com/robots.txt/, это не позволяет мне просмотреть файл robots.txt (произошла ошибка при обработке эта директива). Как я могу это исправить? эта проблема возникает с sitemap.xml, и это вызывает проблемы с инструментом для веб-мастеров. C. Какие-либо идеи по улучшению моих перенаправлений?
мой файл .htaccess
RewriteEngine On
RewriteCond %{HTTP_HOST} ^zeroohm\.ae$ [OR]
RewriteCond %{HTTP_HOST} ^www\.zeroohm\.ae$
RewriteRule ^/?$ "http\:\/\/www\.zeroohm\.com\/\$1\/" [R=301,L]
# check if url has www or not, add www if not available. if avaiable dont do anything.
RewriteCond %{HTTP_HOST} !^$
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*) https://www.%{HTTP_HOST}%{REQUEST_URI}/ [R=301,L]
#end
# force incoming traffic coming from HTTP to Https
RewriteCond %{HTTPS} !on$
RewriteRule ^(.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
#end
#force trainling slash
RewriteBase/
RewriteCond %{REQUEST_URI} !(/$|\.)
RewriteCond %{REQUEST_URI} /+[^\.]+$
RewriteRule ^(.+[^/])$ %{REQUEST_URI}/ [R=301,L]
#end of force trailing slash
# 1.To use URL Alias you need to be running apache with mod_rewrite enabled.
# 2. In your opencart directory rename htaccess.txt to .htaccess.
# For any support issues please visit: http://www.opencart.com
# For security reasons, Option followsymlinks cannot be overridden.
#Options +FollowSymlinks
Options +SymLinksIfOwnerMatch
# Prevent Directoy listing
Options -Indexes
# Prevent Direct Access to files
<FilesMatch "\.(tpl|ini|log)">
Order deny,allow
Deny from all
</FilesMatch>
# cache to keep it at client pc
<ifmodule mod_expires.c>
Expiresactive on
# set default
Expiresdefault "access plus 24 hours"
Expiresbytype image/jpg "access plus 1 months"
Expiresbytype image/gif "access plus 1 months"
Expiresbytype image/jpeg "access plus 1 months"
Expiresbytype image/png "access plus 1 months"
Expiresbytype text/css "access plus 1 months"
Expiresbytype text/javascript "access plus 1 months"
Expiresbytype application/javascript "access plus 1 months"
Expiresbytype application/x-shockwave-flash "access plus 1 months"
</ifmodule>
#gzip compression
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
# SEO URL Settings
# If your opencart installation does not run on the main web folder make sure you folder it does run in ie./becomes /shop/
RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L]
RewriteRule ^download/(.*) /index.php?route=error/not_found [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]
#libwww-perl security fix
RewriteCond %{HTTP_USER_AGENT} libwww-perl.*
RewriteRule .* ? [F,L]
RewriteCond %{THE_REQUEST} \ /index\.php\?_route_=?([^&\ ]*)
RewriteRule^/%1? [R=301,L]
эй, анабхава, СПАСИБО! исправлено .ae -> .com redirect. человек, спасибо. –
, но теперь, если вы посмотрите на http://www.redirect-checker.org/index.php, вы увидите, что есть 2 дополнительных перенаправления. можете ли вы рекомендовать способ уменьшить перенаправление? –
эй, спасибо большое. но посмотрите на результат redirect-checker.org http://zeroohm.com/arduino 301 Перемещено постоянно https://www.zeroohm.com/arduino 301 Перемещено на постоянной основе https://www.zeroohm.com/arduino/ 200 OK –