MyBB Community Forums

Full Version: mybb forum redirect URL
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
in the board configuration the site is :
http://www.mysite.com/forum/

The question is...To not influence GOOGLE SEO url`s how can i make a redirect from :
http://mysite.com/forum/
TO:
http://www.mysite.com/forum/

I tried with HTACCES..The HTACCES Looks like this:


RewriteEngine on
# Google SEO workaround for search.php highlights:
# Make this rule the first rewrite rule in your .htaccess!
RewriteRule ^([^&]*)&(.*)$ http://www.mysite.com/forum/$1?$2 [L,QSA,R=301]

# Google SEO Sitemap:
RewriteRule ^sitemap-([^./]+)\.xml$ misc.php?google_seo_sitemap=$1 [L,QSA,NC]

# Google SEO URL Forums:
RewriteRule ^([^./]+)-f-$ forumdisplay.php?google_seo_forum=$1 [L,QSA,NC]

# Google SEO URL Threads:
RewriteRule ^([^./]+)-t-$ showthread.php?google_seo_thread=$1 [L,QSA,NC]

# Google SEO URL Announcements:
RewriteRule ^([^./]+)-a-$ announcements.php?google_seo_announcement=$1 [L,QSA,NC]

# Google SEO URL Users:
RewriteRule ^([^./]+)-u-$ member.php?action=profile&google_seo_user=$1 [L,QSA,NC]

# Google SEO URL Calendars:
RewriteRule ^([^./]+)-c-$ calendar.php?google_seo_calendar=$1 [L,QSA,NC]

# Google SEO URL Events:
RewriteRule ^([^./]+)-e-$ calendar.php?action=event&google_seo_event=$1 [L,QSA,NC]

# Google SEO 404:
ErrorDocument 404 /forum/misc.php?google_seo_error=404

Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^mysite.com/forum/ [nc]
rewriterule ^(.*)$ http://www.mysite.com/forum/$1 [r=301,nc] 
RewriteCond %{HTTP_HOST} !^www\.domain\.tld$ [NC]
RewriteRule ^(.*)$ http://www.domain.tld/$1 [L,QSA,R=301]

put it at the top, or below the workaround rule
doesn`t works...can you put it for me in the code that i give?
Hmmm I want to do it the other way round and have http://www redirect to http:// without.

Anyway was struggling over this and looking for the solution on here and on another forum and as I was writing this post the awesome dotdavid on forumspromotion posted this which worked perfectly!

Redirect domain.com to http://www.domain.com

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^www.domain.com$ [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301]

Redirect http://www.domain.com to domain.com

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^domain.com$ [NC]
RewriteRule ^(.*)$ http://domain.com/$1 [L,R=301]