phpBB SEO
Boards
Directory  
SEO  
Downloads
  phpBB SEO : Search Engine Optimization, Directory, Forums  
Index
Forums
Annuaire
Référencement
Télécharger
 
  Search Rechercher
    Register
Username :  Password :  Log me on automatically each visit  
S'enregistrer  
 
   
How to 301 redirect forum to subdomain
Goto page 1, 2  Next
 
Post new topic   Reply to topic    phpBB SEO » SEO Forum  » Apache mod Rewrite
::  
Author Message
visio



Joined: 31 May 2007
Posts: 22

How to 301 redirect forum to subdomainPosted: Wed Jun 06, 2007 6:10 pm    Post subject: How to 301 redirect forum to subdomain

I got everything working. Now I want to redirect my forums from domain.com/forums to forums.domain.com

I tried the following:

RewriteCond %{HTTP_HOST} ^(www\.)?domain\.com$
RewriteRule ^forums/(.*) http://forums.domain.com/$1 [R=301,L]

But it didn't work. How do I do this with both advanced mod rewrite installed and zero dup?
Back to top
dcz
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 28 Apr 2006
Posts: 15133

How to 301 redirect forum to subdomainPosted: Wed Jun 06, 2007 8:49 pm    Post subject: Re: How to 301 redirect forum to subdomain

First, you will need to update phpBB config, to make sure it's using the sub domain as a domain, eg "forums.domain.com", and make sure the script path is set to / and not forum/ like before.

For the cookie setting, it looks like you already did the right thing, the dot allows all sub domains at once, so don't touch it.

Then, about the .hatccess it's the same, you're going from a sub folder install to a root install.
So get rid of the current forum .htaccess in the root level and put it, after you've removed all occurrences of "forum/" in it (we don't need to mention a path anymore, the forum is installed in the sub forum's root).

Then, in the main domain's root .htaccess, add this :

Code:
RewriteRule ^forums/(.*) http://forums.example.com/$1 [QSA,R=301]


To http 301 redirect all calls to the forum/ folder (thus from the main domain) to the sud domain.

Add this rewriterule after the www prefix redirection for example, or as you very first rewriterule after mod_rewrite was started.

And it will be it, as long as, of course, the sub domain itself does already works.

++

_________________
Useful links :
SEO Forum || SEO Directory || SEO phpBB || SEO phpBB3 || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Référencement phpBB3 || Recherche
Back to top
Visit poster's website
visio



Joined: 31 May 2007
Posts: 22

How to 301 redirect forum to subdomainPosted: Wed Jun 06, 2007 10:19 pm    Post subject: Re: How to 301 redirect forum to subdomain

It didn't work. when I do what you say it looks right but when I click a board it gives 404.
Back to top
dcz
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 28 Apr 2006
Posts: 15133

How to 301 redirect forum to subdomainPosted: Fri Jun 08, 2007 9:06 pm    Post subject: Re: How to 301 redirect forum to subdomain

Can you tell me precisely where you put the forum .htaccess and post it's content here ?

As well, tell me if there is another .htaccess in the main domain's root.

The sub domain obviously needs to be set up properly as well.

Then, a link could help out to help you out Wink

++

_________________
Useful links :
SEO Forum || SEO Directory || SEO phpBB || SEO phpBB3 || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Référencement phpBB3 || Recherche
Back to top
Visit poster's website
visio



Joined: 31 May 2007
Posts: 22

How to 301 redirect forum to subdomainPosted: Mon Jun 11, 2007 12:37 pm    Post subject: Re: How to 301 redirect forum to subdomain

Well I took it off because it wasn't working and while it was on it screwed up the folder option too.

I would be happy to give a link. Please tell me how I can do this for just the home page, I tried a normal ahref link but it didn't show up.
Back to top
dcz
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 28 Apr 2006
Posts: 15133

How to 301 redirect forum to subdomainPosted: Mon Jun 11, 2007 1:52 pm    Post subject: Re: How to 301 redirect forum to subdomain

You can try with an extra L, for last, in the rewriterule :

Code:
RewriteRule ^forums/(.*) http://forums.example.com/$1 [QSA,R=301,L]


To post a link, just past the full url in the post, hit preview and you'll see it clickable, you can as well use the url bbcode, but it's not required.

++

_________________
Useful links :
SEO Forum || SEO Directory || SEO phpBB || SEO phpBB3 || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Référencement phpBB3 || Recherche
Back to top
Visit poster's website
visio



Joined: 31 May 2007
Posts: 22

How to 301 redirect forum to subdomainPosted: Wed Aug 08, 2007 1:11 am    Post subject: Re: How to 301 redirect forum to subdomain

I have got the forums to work properly on the subdomain so forums.1stsearchenginerankings.com works fine however 1stsearchenginerankings.com/forums is not redirecting to forums.1stsearchenginerankings.com


Here is what is in my .htaccesss


MAIN .htaccess:

Code:
#Options +FollowSymlinks
RewriteEngine On
RewriteBase /

RedirectMatch permanent ^/forums http://forums.1stsearchenginerankings.com/$1

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


# -FrontPage-

IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*

<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
AuthName www.1stsearchenginerankings.com
AuthUserFile /home/search/public_html/_vti_pvt/service.pwd
AuthGroupFile /home/search/public_html/_vti_pvt/service.grp


# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress


AddHandler application/x-httpd-php5 .php






FORUMS .htaccess


Code:
#Options +FollowSymlinks
RewriteEngine On
RewriteBase /

#########################################################
# PHPBB SEO REWRITE RULES #
#########################################################
# AUTHOR : DCZ http://www.phpbb-seo.com/
# STARTED : 01/2006
#####################################################
# FORUMS PAGES
########################
# FORUM INDEX (un-comment if used)
RewriteRule ^index\.html$ /index.php [QSA,L,NC]
# FORUM PROTECTION RULE
RewriteRule ^[a-z0-9_-]*/([^/]+\.html)$ /index.php [R=301,L,NC]
# CATEGORIES
RewriteRule ^[a-z0-9_-]*-c([0-9]+)\.html$ /index.php?c=$1 [QSA,L,NC]
# PAGINATED FORUM
RewriteRule ^[a-z0-9_-]*-f([0-9]+)-([0-9]+)\.html$ /viewforum.php?f=$1&start=$2 [QSA,L,NC]
# FORUM
RewriteRule ^[a-z0-9_-]*-f([0-9]+)\.html$ /viewforum.php?f=$1 [QSA,L,NC]
# PAGINATED TOPIC
RewriteRule ^[a-z0-9_-]*-t([0-9]+)-([0-9]+)\.html$ /viewtopic.php?t=$1&start=$2 [QSA,L,NC]
# TOPIC
RewriteRule ^[a-z0-9_-]*-t([0-9]+)\.html$ /viewtopic.php?t=$1 [QSA,L,NC]
# POST
RewriteRule ^post([0-9]+)\.html$ /viewtopic.php?p=$1 [QSA,L,NC]
#PROFILES
RewriteRule ^member([0-9]+)\.html$ /profile.php?mode=viewprofile&u=$1 [QSA,L,NC]
# END PHPBB PAGES
#####################################################



I am so fed up with this that if anybody can fix it I am willing to pay for it.
Back to top
SeO
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 15 Mar 2006
Posts: 3741

How to 301 redirect forum to subdomainPosted: Wed Aug 08, 2007 8:58 am    Post subject: Re: How to 301 redirect forum to subdomain

Try adding :

Code:
RewriteRule ^forum/(.*)$ http://forum.1stsearchenginerankings.com/$1 [QSA,L,R=301]


After :

Code:
RewriteRule ^(.*)$ http://www.1stsearchenginerankings.com/$1 [L,R=301]


In your main domain .htaccess.

_________________
phpBB SEO || SEO Forum || Forum Référencement
GYM Sitemap & RSS for phpBB3 has been released ! || GYM Sitemap & RSS for phpBB3 est disponible !
Back to top
visio



Joined: 31 May 2007
Posts: 22

How to 301 redirect forum to subdomainPosted: Wed Aug 08, 2007 11:27 am    Post subject: Re: How to 301 redirect forum to subdomain

SeO wrote:
Try adding :

Code:
RewriteRule ^forum/(.*)$ http://forum.1stsearchenginerankings.com/$1 [QSA,L,R=301]


After :

Code:
RewriteRule ^(.*)$ http://www.1stsearchenginerankings.com/$1 [L,R=301]


In your main domain .htaccess.


Thanks for your reply!

I added that(added an 's' too as it is forums not forum Razz) - 1stsearchenginerankings.com/forums redirects properly now(I guess, the browser accepts it) - However a request for this url:
http://www.1stsearchenginerankings.com/forums/general-discussion-f1.html

does not redirect to http://forums.1stsearchenginerankings.com/general-discussion-f1.html
(although if typed in it will work) - instead the first url redirects to this:

http://forums.1stsearchenginerankings.com/?f=1

Now that is the way the urls were before the mod-rewrite. Keep in mind the url bar said it redirected to http://forums.1stsearchenginerankings.com/?f=1 but it still displayed the forum home page.

If you can make sense of all that more power to you...
Back to top
SeO
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 15 Mar 2006
Posts: 3741

How to 301 redirect forum to subdomainPosted: Wed Aug 08, 2007 12:43 pm    Post subject: Re: How to 301 redirect forum to subdomain

mmm

Try :
Code:
RewriteRule ^forums/(.*)$ http://forums.1stsearchenginerankings.com/$1 [L,R=301]

_________________
phpBB SEO || SEO Forum || Forum Référencement
GYM Sitemap & RSS for phpBB3 has been released ! || GYM Sitemap & RSS for phpBB3 est disponible !
Back to top
visio



Joined: 31 May 2007
Posts: 22

How to 301 redirect forum to subdomainPosted: Wed Aug 08, 2007 1:05 pm    Post subject: Re: How to 301 redirect forum to subdomain

SeO wrote:
mmm

Try :
Code:
RewriteRule ^forums/(.*)$ http://forums.1stsearchenginerankings.com/$1 [L,R=301]


Hmm nope returns the same results as the other you posted.
Back to top
visio



Joined: 31 May 2007
Posts: 22

How to 301 redirect forum to subdomainPosted: Wed Aug 08, 2007 1:07 pm    Post subject: Re: How to 301 redirect forum to subdomain

BTW I left

Code:
RedirectMatch permanent ^/forums http://forums.1stsearchenginerankings.com/$1
in the .htaccess- was I supposed to remove that? I tried it in both instances provided and removing the above and inserting only the code you gave gives a 404 error when requesting: http://www.1stsearchenginerankings.com/forums/general-discussion-f1.html
Back to top
SeO
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 15 Mar 2006
Posts: 3741

How to 301 redirect forum to subdomainPosted: Wed Aug 08, 2007 1:53 pm    Post subject: Re: How to 301 redirect forum to subdomain

You should only use one method to do the same thing, with redirectmatch, you still need to capture the part you want to use, should then be :

Code:
RedirectMatch permanent ^/forums/(.*)$ http://forums.1stsearchenginerankings.com/$1

or:
Code:
RedirectMatch permanent ^forums/(.*)$ http://forums.1stsearchenginerankings.com/$1

_________________
phpBB SEO || SEO Forum || Forum Référencement
GYM Sitemap & RSS for phpBB3 has been released ! || GYM Sitemap & RSS for phpBB3 est disponible !
Back to top
visio



Joined: 31 May 2007
Posts: 22

How to 301 redirect forum to subdomainPosted: Wed Aug 08, 2007 2:13 pm    Post subject: Re: How to 301 redirect forum to subdomain

Okay I used the first example and it gave 404 as usual... I tried the second and it worked... sort of.

A request for: http://forums.1stsearchenginerankings.com/general-discussion-f1.html did bring up the appropriate page however somehow this got added to the end of the url: ?f=1 so it returns:
http://forums.1stsearchenginerankings.com/general-discussion-f1.html?f=1

Why is it doing that?
Back to top
visio



Joined: 31 May 2007
Posts: 22

How to 301 redirect forum to subdomainPosted: Thu Aug 09, 2007 11:26 am    Post subject: Re: How to 301 redirect forum to subdomain

Sorry I messed up on the last post Razz

This is what I meant:

Okay I used the first example and it gave 404 as usual... I tried the second and it worked... sort of.

A request for: http://1stsearchenginerankings.com/forums/general-discussion-f1.html did bring up the appropriate page however somehow this got added to the end of the url: ?f=1 so it returns:
http://forums.1stsearchenginerankings.com/general-discussion-f1.html?f=1

Why is it doing that? - Thanks for any suggestions!
Back to top
Display posts from previous:   
Post new topic   Reply to topic    phpBB SEO » SEO Forum  » Apache mod Rewrite
Page 1 of 2 Goto page 1, 2  Next

Navigation Similar Topics

Jump to: