2016-09-21 18 views
1

私はhtaccessファイルを激しくアップグレードしています。しかし、私はちょうど修正できないような2つの問題があります。私はいくつかのアプローチを試みましたが、実際に私のために働いたものはありません二重スラッシュ - オープンカート

  1. 私のウェブサイト:https://www.zeroohm.com/
  2. 私の質問:

    • 私は現在 をzeroohm.comに行くとき、私はzeroohm.comに行けばどのように私は、余分な末尾のスラッシュを削除することができますhttps://www.zeroohm.com//

    • 私がwww.zeroohm.com/robots.txt/に行くと、robots.txtファイルが表示されなくなります(処理中にエラーが発生しました)。この指令)。どうすればこの問題を解決できますか?この問題はsitemap.xmlに起こり、ウェブマスターツールにも問題を引き起こしています。 C.自分のリダイレクトを改善するためのアイデアはありますか?

  3. 私の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]

答えて

0

あなたはあなたのサイトのルートの.htaccessにこれらのルールを守ることができます。

RewriteEngine On 
RewriteBase/

RewriteCond %{HTTP_HOST} ^(?:www\.)?zeroohm\.ae$ [NC] 
RewriteRule^http://www.zeroohm.com%{REQUEST_URI} [R=301,L,NE] 

# check if url has www or not, add www if not available. if avaiable don't do anything. 
RewriteCond %{HTTP_HOST} !^www\. [NC,OR] 
RewriteCond %{HTTPS} off 
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC] 
RewriteRule^https://www.%1%{REQUEST_URI} [R=301,L,NE] 

#force trailing slash  
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_URI} !(/$|\.) 
RewriteCond %{REQUEST_URI} /+[^\.]+$ 
RewriteRule [^/]$ %{REQUEST_URI}/ [R=301,L] 

#libwww-perl security fix 
RewriteCond %{HTTP_USER_AGENT} libwww-perl.* 
RewriteRule^- [F,L] 

RewriteCond %{THE_REQUEST} \ /index\.php\?_route_=?([^&\s]*) 
RewriteRule^/%1? [R=301,L] 

RewriteRule ^sitemap\.xml$ index.php?route=feed/google_sitemap [L,QSA,NC] 

RewriteRule ^googlebase\.xml$ index.php?route=feed/google_base [L,QSA,NC] 

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_=$0 [L,QSA] 

クリアあなたのBこの変更をテストする前にrowserキャッシュを使用してください。

+0

よろしくお願い致します。ありがとうございました! .ae - > .comリダイレクト。男、ありがとう。 –

+0

ですが、今はhttp://www.redirect-checker.org/index.phpを見ると2つの余分なリダイレクトがあることがわかります。リダイレクトを減らす方法をお勧めしますか? –

+0

ねえ、ありがとう。 http://jpoohm.com/arduino 301 Moved Permanently https://www.zeroohm.com/arduino 301 Moved Permanently https://www.zeroohm.com/arduino/ 200 OK –

関連する問題