phpBB2Refugees.com Logo
Not affiliated with or endorsed by the phpBB Group

Register •  Login 

Continue the legacy...

Welcome to all phpBB2 Refugees!Wave Smilie

This site is intended to continue support for the legacy 2.x line of the phpBB2 bulletin board package. If you are a fan of phpBB2, please, by all means register, post, and help us out by offering your suggestions. We are primarily a community and support network. Our secondary goal is to provide a phpBB2 MOD Author and Styles area.

Redirect with htaccess


 
Search this topic... | Search General Support... | Search Box
Register or Login to Post    Index » General Support  Previous TopicPrint TopicNext Topic
Author Message
Holger
Board Member



Joined: 19 Jan 2009

Posts: 509
Location: Hanover


flag
PostPosted: Thu Oct 08, 2009 8:18 am 
Post subject: Redirect with htaccess

Hi,

we just moved the forum from
www.domain.tld/phpBB2/
to
www.domain.tld/

Now I have a redirect in the folder /phpBB2/ which redirects to the root.
index.php:
Code:
<?php // Permanent 301 Redirect via PHP
   header("HTTP/1.1 301 Moved Permanently");
   header("Location: http://www.domain.tld");
   exit();
?>

But, links in Google still goes to the viewtopic and so on in /phpBB2/.
Is there a way to just redirect everything from /phpBB2/ to /, I mean just delete the phpBB2 in the URL?

/Holger
Back to top
dogs and things
Board Member



Joined: 18 Nov 2008

Posts: 621
Location: Spain


flag
PostPosted: Thu Oct 08, 2009 11:11 am 
Post subject: Re: Redirect with htaccess

Place a .htaccess in your domain root folder.

Put
Code:
redirect 301 /phpBB2 http://www.you.com/
in it. If you allready have a .htaccess in place just place the code on a new line in the existing file.

That should do the trick perfectly.

Read htaccess 301 redirect tutorial for more info.

You donīt need to keep your old folder/files in place, just a 301 redirect using .htaccess in your domain root folder is enough.

Greetings.

_________________
phpBB2 will never die, I hope!
Back to top
Holger
Board Member



Joined: 19 Jan 2009

Posts: 509
Location: Hanover


flag
PostPosted: Thu Oct 08, 2009 11:20 am 
Post subject: Re: Redirect with htaccess

Does that also redirect
www.domain.tld/phpBB2/viewtopic.php...
to
www.domain.tld/viewtopic.php...
icon_question.gif icon_redface.gif
Back to top
Holger
Board Member



Joined: 19 Jan 2009

Posts: 509
Location: Hanover


flag
PostPosted: Thu Oct 08, 2009 11:38 am 
Post subject: Re: Redirect with htaccess

Thank you for the link!

I think this would maybe be better
Code:
RewriteEngine On
RewriteRule ^phpBB2/(.*)$ http://www.domain.tld/$1 [R=301,L]

icon_question.gif
Back to top
Holger
Board Member



Joined: 19 Jan 2009

Posts: 509
Location: Hanover


flag
PostPosted: Thu Oct 08, 2009 11:45 am 
Post subject: Re: Redirect with htaccess

icon_redface.gif Naaah! That just shows a blank errorpage icon_redface.gif
Found that here:
http://www.tamingthebeast.net/articles3/changing-domain-names.htm
Back to top
dogs and things
Board Member



Joined: 18 Nov 2008

Posts: 621
Location: Spain


flag
PostPosted: Thu Oct 08, 2009 12:07 pm 
Post subject: Re: Redirect with htaccess

Holger wrote:
Does that also redirect
www.domain.tld/phpBB2/viewtopic.php...
to
www.domain.tld/viewtopic.php...
icon_question.gif icon_redface.gif

Yes,
Code:
redirect 301 /phpBB2 http://www.you.com/
should redirect every request for any file in the old phpBB2 folder to that same file in your domain root.
_________________
phpBB2 will never die, I hope!
Back to top
dogs and things
Board Member



Joined: 18 Nov 2008

Posts: 621
Location: Spain


flag
PostPosted: Sun Oct 11, 2009 8:36 am 
Post subject: Re: Redirect with htaccess

Did you get this to work?

To make it work you will have to change the script path in your ACP => General config settings too, I just realized.

_________________
phpBB2 will never die, I hope!
Back to top
Holger
Board Member



Joined: 19 Jan 2009

Posts: 509
Location: Hanover


flag
PostPosted: Sun Oct 11, 2009 11:33 am 
Post subject: Re: Redirect with htaccess

Yes, it did work! Thank you!
The path was already changed of course.
Back to top
dogs and things
Board Member



Joined: 18 Nov 2008

Posts: 621
Location: Spain


flag
PostPosted: Sun Oct 11, 2009 11:59 am 
Post subject: Re: Redirect with htaccess

Great, glad to hear that! icon_smile.gif
_________________
phpBB2 will never die, I hope!
Back to top
Display posts from previous:   
Register or Login to Post    Index » General Support  Previous TopicPrint TopicNext Topic
Page 1 of 1 All times are GMT
 
Jump to:  

Index • About • FAQ • Rules • Privacy • Search •  Register •  Login 
Not affiliated with or endorsed by the phpBB Group
Powered by phpBB2 © phpBB Group
Generated in 0.0301 seconds using 15 queries. (SQL 0.0026 Parse 0.0009 Other 0.0266)
phpBB Customizations by the phpBBDoctor.com
Template Design by DeLFlo and MomentsOfLight.com Moments of Light Logo