SMFHacks.com

Modifications/Themes => General SMF Forum => Topic started by: shuban on July 25, 2018, 01:47:29 pm

Title: htaccess redirect question
Post by: shuban on July 25, 2018, 01:47:29 pm
I'd like to redirect all my topics (only) to another url. I tried the following, but it didn't work

RewriteEngine On
RewriteRule ^/?topic/([^/d]+)/?$ https://NEWURL.com/index.php?topic=$1 [R=301,L]
Title: Re: htaccess redirect question
Post by: shuban on July 25, 2018, 01:57:16 pm
Also tried:

RewriteRule ^(.*)https:\/\/OLD\.com\/index.php\?topic=(.*)$ https://NEW.com/index.php?topic=$2 [R=301,L]

Didn't work
Title: Re: htaccess redirect question
Post by: SMFHacks on July 25, 2018, 01:58:16 pm
I would make sure ? is escaped in the first part
Title: Re: htaccess redirect question
Post by: shuban on July 25, 2018, 02:03:47 pm
https://regex101.com/r/o8Obr8/1

Tried the following, still don't know.
Title: Re: htaccess redirect question
Post by: SMFHacks on July 25, 2018, 02:06:11 pm
does your topic url look like http://site.com/?topic/877/
Title: Re: htaccess redirect question
Post by: shuban on July 25, 2018, 02:07:45 pm
technically:

Redirect: https://OLD.com/index.php?topic=282181.0 to https://NEW.com/index.php?topic=282181.0
Title: Re: htaccess redirect question
Post by: shuban on July 25, 2018, 03:03:24 pm
Also tried:

RewriteEngine On
RewriteBase /
RewriteRule \/index\.php\?topic=(.*) https://biology-forums.com$1

But still didn't work.