Need htaccess redirect from old to new domain

Get help with installation and running phpBB 3.3.x here. Please do not post bug reports, feature requests, or extension related questions here.
Blacktiger63
Registered User
Posts: 85
Joined: Thu Oct 17, 2013 7:43 pm

Need htaccess redirect from old to new domain

Post by Blacktiger63 »

Hello.

We moved forums from old to new domains, also hosting is changed.

So I used this redirect from the DA panel in .htaccess:

Code: Select all

Redirect 301 / http://new-forum.com/
So this works, if old-forum.com is visited. However, users will find threads like this on Google.

https://old-forum.com/viewtopic.php/?t=1369

This will also redirect to the new domain, but then it looks as if php hasn't parsed.
Image

So how can I use a better .htaccess redirect where all these direct links will redirect to the new forum, but showing in a correct way, so not as if php is not parsing?
User avatar
janus_zonstraal
Registered User
Posts: 6607
Joined: Sat Aug 30, 2014 1:30 pm

Re: Need htaccess redirect from old to new domain

Post by janus_zonstraal »

Try this:

Code: Select all

Redirect 301 (.*)$ https://www.new.com/$1
Sorry! My English is bat ;) !!!
Blacktiger63
Registered User
Posts: 85
Joined: Thu Oct 17, 2013 7:43 pm

Re: Need htaccess redirect from old to new domain

Post by Blacktiger63 »

Thank you, I'm going to try it!
Blacktiger63
Registered User
Posts: 85
Joined: Thu Oct 17, 2013 7:43 pm

Re: Need htaccess redirect from old to new domain

Post by Blacktiger63 »

Looks better but still no php parsing... odd.

Check it if you want.
https://zorin-nl-forum.nl/viewtopic.php/?t=1369

redirects to the .be version.
User avatar
janus_zonstraal
Registered User
Posts: 6607
Joined: Sat Aug 30, 2014 1:30 pm

Re: Need htaccess redirect from old to new domain

Post by janus_zonstraal »

Your certificates are not correct.
And there is nothing on the "old?" domain. Or is it the new?
Last edited by janus_zonstraal on Tue Oct 29, 2024 10:46 pm, edited 1 time in total.
Sorry! My English is bat ;) !!!
Blacktiger63
Registered User
Posts: 85
Joined: Thu Oct 17, 2013 7:43 pm

Re: Need htaccess redirect from old to new domain

Post by Blacktiger63 »

Yes I was too early, but certificates are good now, the old domain was moved to new provider so it took a minute.
But still... main domain redirect is loading correct, but from some thread, the redirect looks like it's not parsing php.

I've had that before some years ago, but forgot what is causing this.

The new domain is the .be domain. The old .nl domain only contains the .htaccess with the line you gave me so empty for the rest.
Both on Vimexx hosting by the way.
Blacktiger63
Registered User
Posts: 85
Joined: Thu Oct 17, 2013 7:43 pm

Re: Need htaccess redirect from old to new domain

Post by Blacktiger63 »

All working now. Thanks!
User avatar
Brf
Support Team Member
Support Team Member
Posts: 53548
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}

Re: Need htaccess redirect from old to new domain

Post by Brf »

Your link has a / after the .php
That is causing the stylesheets to have the wrong URL.
Blacktiger63
Registered User
Posts: 85
Joined: Thu Oct 17, 2013 7:43 pm

Re: Need htaccess redirect from old to new domain

Post by Blacktiger63 »

OMG you're right... Odd though because on the old forum I used the right mouse button and selected to copy the url because I never type such things manually if it can be done that easy.

Something must have gone wrong there, thank you!!

Return to “[3.3.x] Support Forum”