| Author |
|
techwiz Newbie

Joined: 30 December 2009 Location: India
Online Status: Offline Posts: 6
|
| Posted: 30 December 2009 at 6:17am | IP Logged
|
|
|
Hi,
I am a complete noob to htaccess and stuff...please help
me
I have 2 pages /page1.html and /page2.html
I want it to redirect them to
http://www.secondwebsite.com/page1.html and
http://www.secondwebsite.com/page2.html respectively.
For all other pages I want to use:
Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://www.firstwebsite.com/$1 [R=301,L]
How can I do it?
Thanks in advance.
|
| Back to Top |
|
| |
Vyacheslav Admin Group

Joined: 02 July 2008 Location: Ukraine
Online Status: Offline Posts: 1535
|
| Posted: 30 December 2009 at 7:48am | IP Logged
|
|
|
Hello,
Please try the following rules:
Code:
RewriteBase /
RewriteRule ^page1\.html$ http://www.secondwebsite.com/page1.html [NC,L]
RewriteRule ^page2\.html$ http://www.secondwebsite.com/page2.html [NC,L]
|
|
|
__________________ Slavik Shynkarenko,
Helicon Tech.
|
| Back to Top |
|
| |
techwiz Newbie

Joined: 30 December 2009 Location: India
Online Status: Offline Posts: 6
|
| Posted: 01 January 2010 at 4:09am | IP Logged
|
|
|
Worked a treat! You rock!
one more thing... this directory /something should not be redirected under any circumstances. how can I do that?
|
| Back to Top |
|
| |
Vyacheslav Admin Group

Joined: 02 July 2008 Location: Ukraine
Online Status: Offline Posts: 1535
|
| Posted: 04 January 2010 at 10:00am | IP Logged
|
|
|
Hello,
Sorry for delay. We had holidays.
Would you please provide more specific example.
Thanks.
__________________ Slavik Shynkarenko,
Helicon Tech.
|
| Back to Top |
|
| |
techwiz Newbie

Joined: 30 December 2009 Location: India
Online Status: Offline Posts: 6
|
| Posted: 04 January 2010 at 10:16am | IP Logged
|
|
|
No problems at all... :)
I'm using this code right now
Code:
Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://www.firstwebsite.com/$1 [R=301,L]
|
|
|
This thing redirect all my links to firstwebsite.com. I have a directory called /folder ... this shouldn't get redirected
any file (say /folder/blah_blah.html) in /folder shouldn't get redirected anywhere.
Thanks a lot, Suhas
|
| Back to Top |
|
| |
Vyacheslav Admin Group

Joined: 02 July 2008 Location: Ukraine
Online Status: Offline Posts: 1535
|
| Posted: 05 January 2010 at 10:12am | IP Logged
|
|
|
Hello,
I just noticed that this is ISAPI_Rewrite 2 forum, but since all my suggestions work for you I guess you have ISAPI_Rewrite 3. Is it true?
I'll give you solutions for both versions:
2nd
Code:
| RewriteRule (?!folder/)(.*) http\://www.firstwebsite.com/$1 [RP,L] |
|
|
3rd
Code:
| RewriteRule (?!folder/)(.*) http://www.firstwebsite.com/$1 [R=301,L] |
|
|
Edited by Vyacheslav - 05 January 2010 at 10:12am
__________________ Slavik Shynkarenko,
Helicon Tech.
|
| Back to Top |
|
| |
techwiz Newbie

Joined: 30 December 2009 Location: India
Online Status: Offline Posts: 6
|
| Posted: 12 January 2010 at 6:09am | IP Logged
|
|
|
I am really sorry for the late reply. I was busy with my
exams.
I tried this
Code:
RewriteRule (?!folder/)(.*)
http\://www.firstwebsite.com/$1 [RP,L] |
|
|
but I was greeted with a 500 internal server error. So,
its definety not ISAPI_Rewrite 2.
This, sadly, dint work
Code:
RewriteRule (?!folder/)(.*)
http://www.firstwebsite.com/$1 [R=301,L] |
|
|
I seriously dont know why.
Am I doing anything wrong?
Thanks,
Suhas
|
| Back to Top |
|
| |
Vyacheslav Admin Group

Joined: 02 July 2008 Location: Ukraine
Online Status: Offline Posts: 1535
|
| Posted: 12 January 2010 at 10:16am | IP Logged
|
|
|
Hello,
Would you like me to look at your system in order to try and fix the issue?
You may send login credentials to support@helicontech.com.
__________________ Slavik Shynkarenko,
Helicon Tech.
|
| Back to Top |
|
| |
techwiz Newbie

Joined: 30 December 2009 Location: India
Online Status: Offline Posts: 6
|
| Posted: 30 January 2010 at 11:56am | IP Logged
|
|
|
Hi,
I am horribly sorry for the late reply..
noob here...so donno where to put the code..
is this right?
|
| Back to Top |
|
| |
Vyacheslav Admin Group

Joined: 02 July 2008 Location: Ukraine
Online Status: Offline Posts: 1535
|
| Posted: 01 February 2010 at 1:56am | IP Logged
|
|
|
Hello,
Please try the following configuration:
Code:
RewriteCond %{REQUEST_URI} (.*)
RewriteCond %1 !/folder.* [NC]
RewriteRule .? http://www.firstwebsite.com%1 [NC,L,R=301] |
|
|
__________________ Slavik Shynkarenko,
Helicon Tech.
|
| Back to Top |
|
| |
techwiz Newbie

Joined: 30 December 2009 Location: India
Online Status: Offline Posts: 6
|
| Posted: 09 February 2010 at 2:04am | IP Logged
|
|
|
Super awesome!!
thanks for helping a noob..
take care,
Suhas
|
| Back to Top |
|
| |