LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 02-02-2006, 07:26 PM   #1
mr_dizzle
Newbie
 
Registered: Oct 2003
Posts: 27

Rep: Reputation: 15
mod_rewrite


i've searched google and have found plenty of examples, but i can't seen to get this to work.

i'd like to forward any requests sent to

http://www.abc.com/galleries

to

http://www.xyz.com/galleries

basically i want to rewrite any requests to:

/galleries
/galleries/image.jpg
/galleries/index.html
etc etc

basically what i have is a bunch of people linking to galleries on one server. i want to move the galleries to a new server but do not want to break everyone's links. i also want the new url hidden so i figured mod_rewrite would be perfect.

here is what i have tried. i have placed the following in to an .htaccess file in the /galleries directory on abc.com

#this only works if i call http://abc.com/galleries
#if i call http://www.abc.com/galleries/image.jpg it does not work
RewriteEngine on
RewriteRule ^$ http://www.xyz.com/galleries [L]

#this doesn't do a thing
RewriteEngine on
RewriteRule ^/galleries(.*)$ http://xyz.com/galleries [L]


comments/suggestions would be appreciated.

thanks,

Last edited by mr_dizzle; 02-02-2006 at 07:28 PM.
 
Old 02-02-2006, 07:32 PM   #2
mr_dizzle
Newbie
 
Registered: Oct 2003
Posts: 27

Original Poster
Rep: Reputation: 15
a full example....

people have links to:

http://www.abc.com/galleries/001/image001.jpg

the whole /galleries directory is going to be moved to a new domain on a new server:

http://www.xyz.com/galleries

people linking to anything in http://www.abc.com/galleries will still have valid links although the content is really being pulled from that new domain.

keeping the new domain url hidden is important.

thanks,
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
mod_rewrite questions? cadkins Linux - Software 0 03-25-2005 11:02 AM
mod_rewrite help needed j-ray Linux - General 1 03-09-2005 04:41 PM
Apache Mod_rewrite help! soulsniper Linux - Software 0 01-16-2005 05:23 PM
Apache:mod_rewrite MadMikie Linux - Software 0 08-03-2004 07:33 AM
Apache and mod_rewrite notsoevil Linux - General 0 01-23-2002 01:39 PM


All times are GMT -5. The time now is 08:48 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration