Hello my dears ... i really have problem to transfer any vistor which browsing my site with daomin such that example.com ..i want to use www.example.com all times ... i try this line in httaccess RewriteEngine On RewriteCond %{HTTP_HOST} ^example.com [NC] RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301] PHP: and work good for main page ...but i have forumes and i install vbseo ...and this lines makes forums down and browsing failed... so ant method to do that well with vbseo.
RewriteEngine On RewriteCond %{HTTP_HOST} . RewriteCond %{HTTP_HOST} !^www\.domain\.com [NC] RewriteRule (.*) http://www.domain.com/$1 [R=301,L] Use this one there shouldn't have any problem. But if you use subdomain it will make problem. Give me your URL to see.
thanks dear for help but the problem still go... my forum use vbseo and make a wrong with my code and your code... any code alse without rewrite mode ?
It will work fine with vbseo. I'm using without any problem. RewriteCond %{HTTP_HOST} !^www\.yourdomain\.com RewriteRule (.*) http://www.yourdomain.com/$1 [R=301,L] Make sure it's above your other RewriteCond's in the file, but under the RewriteEngine On. If you need more help send me your htaccess file i'll fix it for you.
thanks alot Mr. bouncer69 ... I know this lines from vbseo already but .. my forum located in www.example.com/vb and my .htaccess here ExpiresActive On ExpiresByType image/gif "access 1 week" ExpiresByType image/jpg "access 1 week" ExpiresByType image/jpeg "access 1 week" ExpiresByType image/png "access 1 week" ExpiresByType text/css "access 1 week" ExpiresByType text/js "access 1 week" ExpiresByType application/x-shockwave-flash "access 1 week" ExpiresByType application/x-javascript "access 1 week" <IfModule mod_security.c> SecFilterEngine Off SecFilterScanPOST Off </IfModule> RewriteEngine On RewriteRule ^(sitemap.*\.(xml|txt)(\.gz)?)$ vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L] RewriteRule ^((urllist|sitemap).*\.(xml|txt)(\.gz)?)$ vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L] RewriteCond %{REQUEST_FILENAME} -f RewriteCond %{REQUEST_FILENAME} (admincp|modcp|clientscript|cpstyles|images)/ RewriteRule ^(.*)$ $1 [L] RewriteCond %{QUERY_STRING} !vbseourl= RewriteCond %{REQUEST_FILENAME} !chat RewriteRule ^(.*\.php)$ vbseo.php?vbseourl=$1&%{QUERY_STRING} [L] RewriteRule ^$ vbseo.php?vbseourl=index.php [L] RewriteRule ^(archive/.*)$ vbseo.php?vbseourl=$1&%{QUERY_STRING} [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.+)$ vbseo.php?vbseourl=$1&%{QUERY_STRING} [L] PHP:
Hi, It is very simple. Use the following code after RewriteEngine On. Your .htaccess file must be in your forum directory. RewriteCond %{HTTP_HOST} !^www\.example.\.com RewriteRule (.*) http://www.example.com/vb/$1 [R=301,L] RewriteBase /vb/ Code (markup): If you do not want to use your main directory for other purpose you can redirect to your forum with another .htaccess in the root directory. RewriteEngine On RewriteCond %{HTTP_HOST} !^www\.example\.com RewriteRule (.*) http://www.example.com/vb/$1 [R=301,L] RedirectMatch permanent ^/$ http://www.example.com/vb/ RewriteBase / Code (markup): I hope this will help you. It is tested with my forum and working 100%
Hello sir.. after i put you fist code RewriteCond %{HTTP_HOST} !^www\.example.\.com RewriteRule (.*) http://www.example.com/vb/$1 [R=301,L] RewriteBase /vb/ PHP: my forum is down and the link in my brows displathat : http://www.example.com/vb//home/user/public_html/vb PHP: i hope to find a good soultion... thanks for your help
Hi, Please remove the . after example. Typing mistake. RewriteCond %{HTTP_HOST} !^www\.example\.com RewriteRule (.*) http://www.example.com/vb/$1 [R=301,L] RewriteBase /vb/ Code (markup): and RewriteEngine On RewriteCond %{HTTP_HOST} !^www\.example\.com RewriteRule (.*) http://www.example.com/vb/$1 [R=301,L] RedirectMatch permanent ^/$ http://www.example.com/vb/ RewriteBase / Code (markup):