2013-05-20, 05:27 PM
Hello,
We installed the forum on a subdirectory of the site and the default for the forum is a "naked URL" i.e. "example.com/forum" not "www.example.com/forum".
This is our forum (shortened URL with Google)
The forum is very new and we were supposed to have a look at it earlier, but now threads have been created and Google has indexed us (better than I experienced with vBulletin). We are also using the myBB Google SEO plugin.
We want to redirect so that the forum goes from "example.com/forum/" to "www.example.com/forum/". Our main worry is that we now do this redirecting and create a big issue with the Google SEO plugin and or structure of the threads/URL. Because we have threads already created by members, we're fearing we break them both SEO-wise and in terms of internal structure.
1) We believe we know what code to use but I'd appreciate if you could double check with me that this is the correct code to use to have the forum permanently displaying the www.
# Redirect non-www visitors to www.
Options +FollowSymLinks
RewriteCond %{HTTP_HOST} ^yourdomain.com/forum/ [NC]
RewriteRule ^(.*)$ http://www.yourdomain.com/forum/$1 [L,R=301]
Are the above 3 lines (of code) all we need to have "www." in the url permanently? If not, can you please correct it. Please note that our forum is in a subdirectory (www.example.com/forum/) and that the domain root (www.example) already is redirected to display "www." (we didn't want to use the forum as a main portal).
2) Since we are using Google SEO plugin, where shall we place the code from Point 1? Shall we have a new .htaccess file or insert the code in the .htaccess file that contains the rewriting instructions for Google SEO plugin? If it is the latter option, where in the file do we place the 3 lines of code? Right at the top and before the code for the Google SEO plugin or after?
Also, should we place this .htaccess file ine root of the forum or in the root of the domain?
3) Am I right in assuming the aforementioned 3 lines of code will make the change in all existing threads and pages? Or do we have to add more coding so that any current threads/pages permanently display "www."?
For what is worth, the forum currently displays threads as "example.com/thread-XY" by default and if you type in "www." at the beginning of the URL of a thread, it redirects back to the URL without the "www.". However, paradoxically, the index page (i.e. root of the forum) does take accept both "www.example.com/forum/" and "example.com/forum/".
Really appreciate any help please.
We installed the forum on a subdirectory of the site and the default for the forum is a "naked URL" i.e. "example.com/forum" not "www.example.com/forum".
This is our forum (shortened URL with Google)
The forum is very new and we were supposed to have a look at it earlier, but now threads have been created and Google has indexed us (better than I experienced with vBulletin). We are also using the myBB Google SEO plugin.
We want to redirect so that the forum goes from "example.com/forum/" to "www.example.com/forum/". Our main worry is that we now do this redirecting and create a big issue with the Google SEO plugin and or structure of the threads/URL. Because we have threads already created by members, we're fearing we break them both SEO-wise and in terms of internal structure.
1) We believe we know what code to use but I'd appreciate if you could double check with me that this is the correct code to use to have the forum permanently displaying the www.
# Redirect non-www visitors to www.
Options +FollowSymLinks
RewriteCond %{HTTP_HOST} ^yourdomain.com/forum/ [NC]
RewriteRule ^(.*)$ http://www.yourdomain.com/forum/$1 [L,R=301]
Are the above 3 lines (of code) all we need to have "www." in the url permanently? If not, can you please correct it. Please note that our forum is in a subdirectory (www.example.com/forum/) and that the domain root (www.example) already is redirected to display "www." (we didn't want to use the forum as a main portal).
2) Since we are using Google SEO plugin, where shall we place the code from Point 1? Shall we have a new .htaccess file or insert the code in the .htaccess file that contains the rewriting instructions for Google SEO plugin? If it is the latter option, where in the file do we place the 3 lines of code? Right at the top and before the code for the Google SEO plugin or after?
Also, should we place this .htaccess file ine root of the forum or in the root of the domain?
3) Am I right in assuming the aforementioned 3 lines of code will make the change in all existing threads and pages? Or do we have to add more coding so that any current threads/pages permanently display "www."?
For what is worth, the forum currently displays threads as "example.com/thread-XY" by default and if you type in "www." at the beginning of the URL of a thread, it redirects back to the URL without the "www.". However, paradoxically, the index page (i.e. root of the forum) does take accept both "www.example.com/forum/" and "example.com/forum/".
Really appreciate any help please.