Redirect from Root to sub domain using 301's?

Discussions about Apache mod Rewrite, .htaccess, Use, experiences ... URL Rewriting.

Moderator: Moderators

Redirect from Root to sub domain using 301's?

Postby Orbits » Fri Jul 06, 2007 3:55 am

Heya,

I'm hoping to get some assistance. Here's my config:

I'm running the latest phpBB with Mixed Mode Rewrite, Zero Duplicates. I've got the rewrite code running to also point all http://domain.com to http://www.domain.com being that phpbb is installed in the root of my domain name.

Here's what I'm looking for:

I would like to move the phpBB forum to http://forum.domain.com and have all the old links 301 redirect to that location.

Is that possible? Essentially the reason for this is that I'm building a new site on the root and want to keep my existing index with my site.

Anyone have the mod-rewrite code?

Thanks!!!

-Steve
Orbits
 
Posts: 45
Joined: Sat Jun 16, 2007 3:57 am

Advertisement

Postby dcz » Sun Jul 08, 2007 7:21 pm

Well, it's possible, but it's not the easiest case for redirecting.

If you wanted to only redirect a folder to a sub domain, you could filter the request according to the path asked, redirecting only the request matching the folder to redirect.
Here, we'll have to take care of what we'll be redirecting since some content is supposed to stay in the main domain.

It as well depends on if you where using a mod rewrite or not in the forum. If so, we should be able to build custom HTTP301 redirections, as long as you provide the .htaccess. If not, then, this most likely will have to be dealt with using a bit of php.

Could you tell us a bit more about the precise url to redirect, because in all cases, this will require a per case redirecting.

++
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

Postby Orbits » Mon Jul 09, 2007 6:55 pm

Ouch.... I think I understand what you mean by this being a very difficult task.....

Essentially I want to use the domain for something other than JUST the Forum like it is now (PHPBB is built in the ROOT of the domain name) - http://www.microsoftpost.com. I want to install a BLOG using wordpress or something and then use the phpbb as a forum. Howevery, with 30k posts already indexed with google I didn't want to have to send out all those 404's.

It appears I'll just need to take the hit and move the site to a subfolder or subdomain and send out the 404's......

Thanks for looking at the problem DCZ

-Steve
Orbits
 
Posts: 45
Joined: Sat Jun 16, 2007 3:57 am

Postby dcz » Wed Jul 11, 2007 6:49 pm

stevefree wrote:It appears I'll just need to take the hit and move the site to a subfolder or subdomain and send out the 404's......


Don't !

30k 404s could lead up to a blackist, at least would jeopardize a lot your ranking.

I did not say it was not possible, I just said that we must perform a per case redirection, which can be nothing more than small tweaks on the rewriterule and few lines of code.

As well, you could imagine to install wordpress in the same folder as phpBB, would only require to rename either phpBB's or wordpress index.php file and mod the related rewriterules accordingly.

But trust me, you don't want 30k 404 pages.

++
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

Postby Orbits » Tue Jul 17, 2007 6:34 am

dcz wrote:
stevefree wrote:It appears I'll just need to take the hit and move the site to a subfolder or subdomain and send out the 404's......


Don't !

30k 404s could lead up to a blackist, at least would jeopardize a lot your ranking.

I did not say it was not possible, I just said that we must perform a per case redirection, which can be nothing more than small tweaks on the rewriterule and few lines of code.

As well, you could imagine to install wordpress in the same folder as phpBB, would only require to rename either phpBB's or wordpress index.php file and mod the related rewriterules accordingly.

But trust me, you don't want 30k 404 pages.

++


PHEW.... I'm glad I waited :)

So, if I put them both in the root, what are your thoughts? Both of the applications use index.php as the ROOT/default page. Could I do something like rename the index.php to phpbb_index.php and then do some redirection? What would you recommend?
Orbits
 
Posts: 45
Joined: Sat Jun 16, 2007 3:57 am

Postby dcz » Thu Jul 19, 2007 9:59 am

There is a mod that teaches you how to rename the phpBB index.php file to whatever you like (forum.php at first if I recall well).

It's pretty simple to implement, like renaming the file and editing the page_header.php link to index.

This would mean to copy / rename the index() function in phpbb_seo_class.php to forum() and would work right away.

Then, you could install wordpress without any trouble in the same folder, as long as you add the wordpress rewriterules at the end of your .htaccess (after the phpBB ones).

++
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 Apache mod Rewrite

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 3 guests