General Community > Scripting Help

Mod Rewrite

(1/3) > >>

Marsh:
Hey, i recently changed my forum directory from /smf to /smf2 for various reasons. All my search results and forum links are still going to the /smf link and then redirect to smf2.

Any idea how i would go about a mod_rewrite to fix all the links when clicked in search engines?

So i basically need to change
http://www.touchofdeathforums.com/smf/index.php?topic=78441.0
to
http://www.touchofdeathforums.com/smf2/index.php?topic=78441.0

My attempt


--- Code: ---RewriteEngine on
RewriteRule ^smf/index.php(\w+)/([0-9]+)$ /smf2/index.php?topic=$1

--- End code ---

Thanks a lot if anyone can help

CapadY:
take a look at Repair Settings

Yoshi:

--- Quote from: CapadY on July 05, 2012, 03:42:13 AM ---take a look at Repair Settings

--- End quote ---
The OP probably already has his/her forum setup at the new address, he/she is talking about what should happen with the existing links in search engines and stuff like that. You can of course run it to check if everything is correctly set, one wrong URL and the search engines pick the wrong thing.

Marsh:

--- Quote from: Yoshi2889 on July 05, 2012, 03:47:55 AM ---
--- Quote from: CapadY on July 05, 2012, 03:42:13 AM ---take a look at Repair Settings

--- End quote ---
The OP probably already has his/her forum setup at the new address, he/she is talking about what should happen with the existing links in search engines and stuff like that. You can of course run it to check if everything is correctly set, one wrong URL and the search engines pick the wrong thing.

--- End quote ---

Exactly!

Antes:

--- Code: ---Redirect 301 / http://www.touchofdeathforums.com/smf2/
--- End code ---

place it to your smf (not smf2) folder's .htaccess

Navigation

[0] Message Index

[#] Next page

Go to full version