2017-02-01 93 views
1

你好吗?我的子网站重定向做主网站的主页,如果URL有'www'

我有一个wordpress多站点,我的主页是http://www.chablau.com.br和一个子站点(http://chablau.com.br/blog)。如果子网址与'www'一起使用,则会返回404错误。

如果更改子网站的域名www.chablau.com.br/blog,网址不含“www”会送我到主站点的主页

eg.: `http://chablau.com.br/blog/` works fine 

    `http://www.chablau.com.br/blog returns` a 404 error 

什么人有什么任何线索碰巧?波纹管,你可以找到什么是我的.htaccess

# BEGIN WordPress 
<IfModule mod_rewrite.c> 
RewriteEngine On 
RewriteBase/
RewriteRule ^index\.php$ - [L] 

# add a trailing slash to /wp-admin 
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L] 

RewriteCond %{REQUEST_FILENAME} -f [OR] 
RewriteCond %{REQUEST_FILENAME} -d 
RewriteRule^- [L] 
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L] 
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L] 
RewriteRule . index.php [L] 
</IfModule> 

# END WordPress 

<FilesMatch "\.(ttf|ttc|otf|eot|woff)$"> 
    <IfModule mod_headers.c> 
     Header set Access-Control-Allow-Origin "*" 
    </IfModule> 
</FilesMatch> 

SetEnvIfNoCase User-Agent "Abonti|aggregator|AhrefsBot|asterias|BDCbot|BLEXBot|BuiltBotTough|Bullseye|BunnySlippers|ca\-crawler|CCBot|Cegbfeieh|CheeseBot|CherryPicker|CopyRightCheck|cosmos|Crescent|discobot|DittoSpyder|DOC|DotBot|Download Ninja|EasouSpider|EmailCollector|EmailSiphon|EmailWolf|EroCrawler|Exabot|ExtractorPro|Fasterfox|FeedBooster|Foobot|Genieo|grub\-client|Harvest|hloader|httplib|HTTrack|humanlinks|ieautodiscovery|InfoNaviRobot|IstellaBot|Java/1\.|JennyBot|k2spider|Kenjin Spider|Keyword Density/0\.9|larbin|LexiBot|libWeb|libwww|LinkextractorPro|linko|LinkScan/8\.1a Unix|LinkWalker|LNSpiderguy|lwp\-trivial|magpie|Mata Hari|MaxPointCrawler|MegaIndex|Microsoft URL Control|MIIxpc|Mippin|Missigua Locator|Mister PiX|MJ12bot|moget|MSIECrawler|NetAnts|NICErsPRO|Niki\-Bot|NPBot|Nutch|Offline Explorer|Openfind|panscient\.com|PHP/5\.\{|ProPowerBot/2\.14|ProWebWalker|Python\-urllib|QueryN Metasearch|RepoMonkey|RMA|SemrushBot|SeznamBot|SISTRIX|sitecheck\.Internetseer\.com|SiteSnagger|SnapPreviewBot|Sogou|SpankBot|spanner|spbot|Spinn3r|suzuran|Szukacz/1\.4|Teleport|Telesoft|The Intraformant|TheNomad|TightTwatBot|Titan|toCrawl/UrlDispatcher|True_Robot|turingos|TurnitinBot|UbiCrawler|UnisterBot|URLy Warning|VCI|WBSearchBot|Web Downloader/6\.9|Web Image Collector|WebAuto|WebBandit|WebCopier|WebEnhancer|WebmasterWorldForumBot|WebReaper|WebSauger|Website Quester|Webster Pro|WebStripper|WebZip|Wotbox|wsr\-agent|WWW\-Collector\-E|Xenu|yandex|Zao|Zeus|ZyBORG|coccoc|Incutio|lmspider|memoryBot|SemrushBot|serf|Unknown|uptime files" bad_bot 
Deny from env=bad_bot 
# END Bad Bot Blocker 

回答

0

我认为这个问题是你的虚拟主机设置使用“域chablau.com.br”,然而它应该是“www.chablau.com.br “然后你在你的htaccess中添加一个规则,将非www重定向到www将解决你的问题

+0

感谢你的信息工作,尤其是.htaccess洞察力。如果有人正在寻找如何做到这一点,请查看此链接 http://dense13.com/blog/2008/02/27/redirecting-non-www-to-www-with-htaccess/ –