http:// to http://www

Discussions and support about the different URL Rewriting techniques for phpBB.

Moderator: Moderators

http:// to http://www

Postby andrius757 » Fri Mar 12, 2010 11:23 am

Hello, I read some topics in google about rewriting and they suggested me to use:
Code: Select all
RewriteEngine On
RewriteCond %{HTTP_HOST} !^cshama\.lt$
RewriteRule (.*) http://www.cshama.lt/$1 [R=301,L]


As first line is already in .htaccess, I added those two lines just after first line. However redirection doesn't work and sometimes I get wrong redirection error when accessing without www. So is this becouse of conflict with phpbb-seo or what?
andrius757
 
Posts: 6
Joined: Mon Dec 07, 2009 8:06 pm

Advertisement

Re: http:// to http://www

Postby dcz » Fri Mar 12, 2010 1:57 pm

The USU does add the required rewriterules to ensure that you will be using the domain as set in acp (eg with or without www), but since it can only work if the config was up to date when generating, they are left commented :
Code: Select all
# HERE IS A GOOD PLACE TO FORCE CANONICAL DOMAIN
# RewriteCond %{HTTP_HOST} !^www\.example\.com$ [NC]
# RewriteRule ^(.*)$ http://www.example.com/$1 [QSA,L,R=301]


What you tried is not too far form it, but cannot work. Humanly speaking, what you did was "if the domain hitting this .htaccess is not cshama.lt, then redirect to -www.cshama.lt". While the logic is "if the domain hitting this .htaccess is not -www.cshama.lt, then redirect to -www.cshama.lt".

FYI : Locking the www in urls

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21219
Joined: Fri Apr 28, 2006 9:03 pm

Re: http:// to http://www

Postby andrius757 » Fri Mar 12, 2010 7:05 pm

Ok you helped much :). I don't want to create new thread so I'll ask there. robots.txt User-Agent * means that for all bots? If I want to make separate for Google [bot] so I should write User-Agent Google [Bot]? And those disallow lines mean that bots won't be able to access that file? Because i have disallow viewtopic and viewforum and I think that's why my board is not indexed?
andrius757
 
Posts: 6
Joined: Mon Dec 07, 2009 8:06 pm

Re: http:// to http://www

Postby dcz » Sun Mar 14, 2010 12:55 pm

USU install wrote:__________________
NOTE: robots.txt :
__________________

You will find a sample robots.txt file in the contrib/ folder of this package.
The robots.txt file must be uploaded in your domain's root folder (can be different from the phpBB one).
You must obviously replace phpbb/ with your real phpBB installation folder (or with nothing if it's installed in the domain's root).

IMPORTANT :
If your forum previously was indexed with the natural urls (viewtopic.php etc...), then you must make sure
that the robots.txt advised for our mod rewrite is not installed, if so DELETE it from the server.
This because we want to redirect old urls before we disallow them, it's CRUCIAL!
In such case, at least two after you activated the zero duplicate, you can safely implement the robots.txt.


So it looks like you need to install / activate the zero duplicate (with post redirection set to at least "guests") and delete your current robots.txt ASAP.

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21219
Joined: Fri Apr 28, 2006 9:03 pm


Return to phpBB mod Rewrite

Who is online

Users browsing this forum: No registered users and 3 guests