Log in

View Full Version : Urgently need a .htaccess rule


jscieza
07-20-2008, 06:35 PM
Hi to everyone,

I have been using tfSEO (https://vborg.vbsupport.ru/showthread.php?t=173738) for my forum for 4 months and all URLs (showthread and forumdisplay) has been rewritten with a 301 redirect so now Google has my index with the following URL structure:

http://www.mydomain.com/f149/example-thread-title-23313/

However with tfSEO uninstalled (since yesterday), my URLs structure are the classic ones:

http://www.mydomain.com/showthread.php?t=23313

So I urgently need to know if there is possible to set-up a .htaccess rule to 'revert" this redirection. There are more than 12,000 threads on my forum and I really do not want to get millions of 404 erros.

Please help me if you know how I can solve it. I will be very thanked.

Thank you very much for your help!

Joanthan.

snakes1100
07-20-2008, 06:38 PM
You need to post in the thread you got the modification from, that hack does show as supported.

superjeff
07-20-2008, 07:26 PM
Disable the plugin don't delete the .htaccess, you will no get 404 errors, but easly duplicate content.

But really d'like to know why disinstalled..

jscieza
07-20-2008, 09:19 PM
Hi Jeff,

I have just tell you the reason by PM.

Could you please tell me a .htaccess rule which could "revert" the redirections made by tfSEO? Any ideas guys? For example:

http://www.mydomain.com/f149/example-thread-title-23313/

to

http://www.mydomain.com/showthread.php?t=23313

Thank you very much for help!

Jonathan.

yahsuah
12-15-2011, 05:53 PM
I have been looking for this too.

kh99
12-15-2011, 06:36 PM
I should start out by saying that I don't know a lot about writing htaccess files. But if you look at the last page of the mod thread, the author (posting with a different account) has provided an htaccess file (https://vborg.vbsupport.ru/showpost.php?p=2033228&postcount=1068) for converting from his mod to vb4 style urls. You didn't say you wanted vb4 urls, but i think the first part of what was posted might work to do what you want:

RewriteEngine on

RewriteRule ^(.*)t([0-9]+)(.*)newpost(.*)$ showthread.php?t=$2&goto=newpost [QSA,L]
RewriteRule ^(.*)f(.*)/(.*)t([0-9]+)(.*)/post([0-9]+)(.*)$ showpost.php?p=$6 [QSA,L]
RewriteRule ^(.*)f(.*)/(.*)t([0-9]+)(.*)/([a-z]+)([0-9]+)(.*)$ showthread.php?t=$4&page=$7 [QSA,L]
RewriteRule ^(.*)f(.*)/(.*)t([0-9]+)(.*)$ showthread.php?t=$4 [QSA,L]
RewriteRule ^(.*)f([0-9]+)/([a-z]+)([0-9]+)(.*)$ forumdisplay.php?f=$2&page=$4 [QSA,L]
RewriteRule ^f([0-9]+)(.*)$ forumdisplay.php?f=$1 [QSA,L]
RewriteRule ^(.*)-f([0-9]+)(.*)$ forumdisplay.php?f=$2 [QSA,L]


one thing I found out by testing it out is that if you have your forum root in a subdirectory (forum/showthread.php, etc), then you need to add the directory to each of these rules, like for instance

RewriteRule ^(.*)t([0-9]+)(.*)newpost(.*)$ forum/showthread.php?t=$2&goto=newpost [QSA,L]