yes but doesn't work on main site
This is a discussion on [How to] Setup www.yourdomain.com or yourdomain.com (www vs. non-www) - With .htaccess 301 redirects within the General Discussion forums, part of the vBSEO SEO Plugin category; yes but doesn't work on main site...
yes but doesn't work on main site
You should create a separate .htaccess in domain root for that.
Oleg Ignatiuk / Crawlability Inc.
vBSEO 3.6.0 GOLD Released!
Unveiling the NEW vBSEO Sitemap Generator 3.0. - available NOW for vBSEO Customers!
i have already 2 .htaccess files, 1 domain root - 1 forum root
What is your domain root .htaccess? Do I understand correctly that it's top domain URL is not redirected?
Oleg Ignatiuk / Crawlability Inc.
vBSEO 3.6.0 GOLD Released!
Unveiling the NEW vBSEO Sitemap Generator 3.0. - available NOW for vBSEO Customers!
the top domain is not redirected and in the forum our members have problems to log in
Code:RewriteEngine On RewriteCond %{HTTP_HOST} ^www\.player-art\.com$ RewriteRule ^(.*)$ http://player-art.com/$1 [L,R=301]
Please open a ticket with ftp access for troubleshooting.
Oleg Ignatiuk / Crawlability Inc.
vBSEO 3.6.0 GOLD Released!
Unveiling the NEW vBSEO Sitemap Generator 3.0. - available NOW for vBSEO Customers!
Ok open
Thanks
Update: the issues fixed by changing Wordpress URL to non-www domain as well.
Oleg Ignatiuk / Crawlability Inc.
vBSEO 3.6.0 GOLD Released!
Unveiling the NEW vBSEO Sitemap Generator 3.0. - available NOW for vBSEO Customers!
Hello,
I'm having trouble with this, I havein the web root andCode:##AddType application/x-httpd-php5 .php RewriteEngine on RewriteCond %{HTTP_HOST} !^www\.jeep-cj\.com RewriteRule (.*) http://www.jeep-cj.com/$1 [R=301,L]in the forum root. The rewrite works for the root pages rewritesCode:# Comment the following line (add '#' at the beginning) # to disable mod_rewrite functions. # Please note: you still need to disable the hack in # the vBSEO control panel to stop url rewrites. RewriteEngine On # Some servers require the Rewritebase directive to be # enabled (remove '#' at the beginning to activate) # Please note: when enabled, you must include the path # to your root vB folder (i.e. RewriteBase /forums/) #RewriteBase / #RewriteCond %{HTTP_HOST} !^www\.yourdomain\.com #RewriteRule (.*) http://www.yourdomain.com/forums/$1 [L,R=301] RewriteRule ^((urllist|sitemap_).*\.(xml|txt)(\.gz)?)$ vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L] RewriteCond %{REQUEST_URI} !(admincp/|modcp/|cron) RewriteRule ^((archive/)?(.*\.php(/.*)?)?)$ vbseo.php [L,QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !^(admincp|modcp|clientscript|cpstyles|images)/ RewriteRule ^(.+)$ vbseo.php [L,QSA]but does not work in pages below the root such as the forumsCode:jeep-cj.com to www.jeep-cj.comAny advice would be apreciated.Code:jeep-cj.com/forums DOES NOT rewrite to www.jeep-cj.com/forums
Thanks,
In forums/.htaccess you should find:
and replace with:Code:#RewriteCond %{HTTP_HOST} !^www\.yourdomain\.com #RewriteRule (.*) http://www.yourdomain.com/forums/$1 [L,R=301]
Code:RewriteCond %{HTTP_HOST} !^www\.jeep-cj\.com RewriteRule (.*) http://www.jeep-cj.com/forums/$1 [L,R=301]
Oleg Ignatiuk / Crawlability Inc.
vBSEO 3.6.0 GOLD Released!
Unveiling the NEW vBSEO Sitemap Generator 3.0. - available NOW for vBSEO Customers!
After trying that, the pagestill does not rewrite toCode:jeep-cj.com/forums- it still stays the same. I have tried a new browser and refreshing the pages. Still will not add the www to the link.Code:www.jeep-cj.com/forms
I thought that the rewrite in the root public_html directory was recursive, but it seems that that is not so.
Very frustrating... Ideas?
Thanks,
What is your .htaccess file in forums/ folder now?
Oleg Ignatiuk / Crawlability Inc.
vBSEO 3.6.0 GOLD Released!
Unveiling the NEW vBSEO Sitemap Generator 3.0. - available NOW for vBSEO Customers!
Per the first post (in the instruction of this thread) I made itRoot folder.Code:RewriteEngine on RewriteCond %{HTTP_HOST} !^www\.jeep-cj\.com RewriteRule (.*) http://www.jeep-cj.com/$1 [R=301,L]
Thanks for the help...![]()
Sorry - you said forums folder...Code:# Comment the following line (add '#' at the beginning) # to disable mod_rewrite functions. # Please note: you still need to disable the hack in # the vBSEO control panel to stop url rewrites. RewriteEngine On # Some servers require the Rewritebase directive to be # enabled (remove '#' at the beginning to activate) # Please note: when enabled, you must include the path # to your root vB folder (i.e. RewriteBase /forums/) #RewriteBase / #RewriteCond %{HTTP_HOST} !^www\.jeep-cj\.com\forums\ #RewriteRule (.*) http://www.jeep-cj.com/forums/$1 [L,R=301] RewriteRule ^((urllist|sitemap_).*\.(xml|txt)(\.gz)?)$ vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L] RewriteCond %{REQUEST_URI} !(admincp/|modcp/|cron) RewriteRule ^((archive/)?(.*\.php(/.*)?)?)$ vbseo.php [L,QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !^(admincp|modcp|clientscript|cpstyles|images)/ RewriteRule ^(.+)$ vbseo.php [L,QSA]]
Sorry, I'm feeling pretty dumb right now... I had forgot to uncomment it out...
It works now.
So, help understand a little here.
The root .htacess file is NOT recursive?
I will need to add a seperate .htacess file for all the folders I want to rewrite and add www?
Thanks,