General Community > Scripting Help

Redirect IPB 3 URLs to SMF2 URLs ?

(1/5) > >>

phantomm:
A while ago i was asking how to redirect old URL from PHP-Fusion to new SMF2 format.

Now I have similar question :)

How to redirect URLs from IPB3 to SMF2?

Old URL:

--- Code: ---http://example.pl/index.php?/topic/631-wymiana-linkami/
--- End code ---
New URL:

--- Code: ---http://example.pl/index.php?topic=631
--- End code ---

Antes:

--- Code: ---RedirectMatch 301 /index.php?/topic/(.*) /index.php?topic=$1
--- End code ---

your smf links became something like this (i think)

.../index.php?topic=631-wymiana-linkami (which needs to work too)

phantomm:
doesn't work for me:

--- Quote ---Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@*** and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

Apache/2 Server at *** Port 80
--- End quote ---

but thanks for trying ;)

phantomm:
Maybe someone else have some ideas?

emanuele:

--- Quote from: Antes on July 04, 2012, 05:24:29 AM ---
--- Code: ---RedirectMatch 301 /index.php?/topic/(*.) /index.php?topic=$1
--- End code ---

--- End quote ---
It should be .*, not *. I think.
BTW I hate htaccess and it hates me... lol

Looking around I think this should work:

--- Code: ---RewriteCond %{QUERY_STRING} ^/topic/(.*)
RewriteRule ^(.+) index.php?topic=$1 [R=301,L]

--- End code ---

Navigation

[0] Message Index

[#] Next page

Go to full version