LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   mod_rewrite (https://www.linuxquestions.org/questions/linux-general-1/mod_rewrite-411052/)

mr_dizzle 02-02-2006 07:26 PM

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,

mr_dizzle 02-02-2006 07:32 PM

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,


All times are GMT -5. The time now is 09:49 PM.