Need help with redirect .htaccess file
Post new topic   Reply to topic   Printer Friendly Page     Forum IndexHelp
Author Message
farbird
Nice poster


Joined: Sep 19, 2005
Posts: 121

PostPost subject: Need help with redirect .htaccess file
Posted: Mon Jan 29, 2007 9:52 am
Reply with quote

I have an old site

www.oldsite.com [ old CMS system ]

and a new site

main.newsite.com [ dragonfly 9.10 ]
[this is actually located in /newsite/main ]
there are a lot of old links from other affiliate sites which still link to the oldsite forum

ie
www.oldsite.com/forums...opic=12345

I want to redirect such that it will use the dragonfly threads instead.. [all the threads were imported to dragonfly already ]

ie to redirect from
www.oldsite.com/forums...opic=12345
to
main.newsite.com/Forums/viewtopic/t=12345.html

I tried to modify the root .htaccess file by including this line.

Code:
RedirectMatch permanent ^/forum/index.php?showtopic=$ http://main.newsite.com/Forums/viewtopic/t=$1.html

however, this isnt working as I expected.

can any htaccess experts help?


farbird's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
9.0.6.1
Back to top
View user's profile Visit poster's website
farbird
Nice poster


Joined: Sep 19, 2005
Posts: 121

PostPost subject: Re: Need help with redirect .htaccess file
Posted: Tue Jan 30, 2007 2:41 pm
Reply with quote

someone pls help

farbird's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
9.0.6.1
Back to top
View user's profile Visit poster's website
xfsunoles
XHTML Specialist


Joined: Apr 30, 2004
Posts: 2502
Location: Melbourne, Florida

PostPost subject: Re: Need help with redirect .htaccess file
Posted: Tue Jan 30, 2007 5:30 pm
Reply with quote

RedirectMatch permanent ^/forum/index.php?showtopic=(0-9)$ main.newsite.com/Forum.../t=$1.html

i dunno this, its not fully testing

_________________

Firefox is my Favorite Browser

xfsunoles's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Apache/1.3.34 (Unix)/4.0.25-standard/4.4.1/CVS
Back to top
View user's profile Visit poster's website AIM Address MSN Messenger Yahoo Messenger
WebSiteGuru
1000+ Posts Club


Joined: Jun 09, 2005
Posts: 2321

PostPost subject: Re: Need help with redirect .htaccess file
Posted: Tue Jan 30, 2007 5:56 pm
Reply with quote

Hmm, I though that I remember there is a way to redirect olddomain to newdomain by using .htaccess.

Here you go! Wink

http://www.searchenginepromotionhelp.com wrote:

Make All URLs Point To One Domain
Here is a way to use the .htaccess file on Apache servers so that all URLs resolve to just one domain. Here at Search Engine Promotion Help I want to use the fully qualified domain name www.searchenginepromotionhelp.com for all URLs. Here is the content of our .htaccess file which makes this happen:

RewriteEngine on

RewriteCond %{HTTP_HOST} !^www\.searchenginepromotionhelp\.com [NC]
RewriteCond %{HTTP_HOST} !^$
RewriteRule ^(.*) www.searchenginepromot...elp.com/$1 [L,R=301]


The first line turns the RewriteEngine on so the following code will work.

The second line is TRUE if the host is not www.searchenginepromotionhelp.com. The \ character is required to "escape" the . character. (The [NC] flag means to ignore case.)

The third line is TRUE if host is not an empty string.

The fourth line is executed if the previous two conditions return TRUE. This line says to redirect permanently to the fully qualified domain name (www.searchenginepromotionhelp.com). The L flag means this is the last rewrite directive, the "R=301" flag says to redirect to the rewritten URL permanently (HTTP response code 301).

You can also read it at the site:

www.searchenginepromot...ection.php

_________________
Lead Theme Designer - WebSiteGuru Designs

WebSiteGuru's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux 2.6.9 / Apache 2.2.6 / MySQL 5.0.27 / PHP 5 / DF Version 9.2.1
Back to top
View user's profile Visit poster's website Yahoo Messenger
farbird
Nice poster


Joined: Sep 19, 2005
Posts: 121

PostPost subject: Re: Need help with redirect .htaccess file
Posted: Sat Feb 03, 2007 3:02 am
Reply with quote

tried it..
the ? after showtopic causes everything to screw up.
if there was no ?.. the redirect will work fine...

anyone whom migrated CMS had this problem?

I still have tons of referring links from other forums linking to my old system..

Users whom tries to access the old CMS content wasnt able to get the the same page in the new CMS...



xfsunoles wrote:
RedirectMatch permanent ^/forum/index.php?showtopic=(0-9)$ main.newsite.com/Forum.../t=$1.html

i dunno this, its not fully testing


farbird's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
9.0.6.1
Back to top
View user's profile Visit poster's website
bart2
Newbie


Joined: Jan 30, 2007
Posts: 38
Location: USA

PostPost subject: Re: Need help with redirect .htaccess file
Posted: Sat Feb 03, 2007 5:22 am
Reply with quote

just insert a backslash immediately before the questionMark char in the regex pattern posted above, and that RedirectMatch statement should do the job!


Please post back to let us know the result


bart2's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
DragonflyCMS version 9.1.1.0
Back to top
View user's profile
farbird
Nice poster


Joined: Sep 19, 2005
Posts: 121

PostPost subject: Re: Need help with redirect .htaccess file
Posted: Sat Feb 03, 2007 5:28 am
Reply with quote

tried..

returned same results...


farbird's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
9.0.6.1
Back to top
View user's profile Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   Printer Friendly Page     Forum IndexHelp All times are GMT
Page 1 of 1


Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

stopsoftwarepatents.eu petition banner
User Info [x]

Welcome Anonymous

Nickname
Password
(Register)

Last CVS commits [x]

Languages [x]

Community [x]

Support for DragonflyCMS in a other languages:

Deutsch
Español

X-links [x]
UltraEdit Browse Happy logo Firefox MySQL PostgreSQL Valid CSS! Valid XHTML 1.0! Unicode Encoded Badge NukeBiz Resources Raven DragonflyCMS Dedicated Now InsideSupport Lampe Berger

Preview theme [x]
Each user can view the site with a different theme.
Themes marked with a * also change the forum look.


You are seeing squares or questionmarks on this page?

All content of this website is copyrighted by the Creative Commons NC-SA
The logos and trademarks used on this site are the property of their respective owners
We are not responsible for comments posted by our users, as they are the property of the poster.
Our server runs on a P3 1.2GHz with 512MB RAM with no accelerators
Support GoPHP5.org
This page generated in 0.4168 seconds with 16 DB Queries in 0.0333 seconds
Memory Usage: 2.92 MB
Interactive software released under GNU GPL, Code Credits, Privacy Policy