0
我檢查我的網站在線SEO檢查,並建議我要修復這個錯誤:IP規範化,Rails 3的應用
Your site's IP xxx.xxx.xx.xxx does not redirect to your site's domain name.
因此,作爲建議我加入一些代碼位於公共目錄我htacces文件。當然用IP地址代替x。
RewriteEngine On
RewriteCond %{HTTP_HOST} ^XXX\.XXX\.XXX\.XXX
RewriteRule (.*) http://www.yourdomain.com/$1 [R=301,L]
但後來重新啓動應用程序後,我再次檢查與SEO檢查器,並再次顯示相同的錯誤。 這是我的完整htacces文件:
PassengerAppRoot /home3/ecotec11/rails_apps/darbs/
<IfModule mod_passenger.c>
Options -MultiViews
PassengerResolveSymlinksInDocumentRoot on
#Set this to whatever environment you'll be running in
RailsEnv development
RackBaseURI/
SetEnv GEM_HOME /home3/ecotec11/ruby/gems/gems
</IfModule>
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www.darbs.ecotechno.lv$ [NC]
RewriteRule ^(.*)$ http://www.darbs.ecotechno.lv/$1 [L,R=301]
RewriteCond %{HTTP_USER_AGENT} libwww-perl.*
RewriteRule .* – [F,L]
RewriteCond %{HTTP_HOST} ^173\254\28\107
RewriteRule (.*) http://www.darbs.ecotechno.lv/$1 [R=301,L]
有什麼建議嗎?
感謝
當您在瀏覽器的地址窗口XXX.XXX.XXX.XXX中輸入時,它是否因爲重定向而更改爲www.yourdomain.com? –
@AlexanderGelbukh不,它只是顯示我的託管公司的徽標和消息:沒有在此地址配置網站。 – Edgars
@AlexanderGelbukh我添加了完整的htaccess代碼。 – Edgars