Cross-Domain / Server URL scrambling

Discuss practical ways rearrange URLs using mod_rewrite.

Cross-Domain / Server URL scrambling

Postby Guest » Sun Jul 04, 2004 5:31 am

Hello all : )

I have something like this setup:
Code: Select all
RewriteRule   ^([0-9]{4})/([0-9]{2})/((.+){3})/ http://serv2.site/content/$1/$2/$3  [PT]


Which is suppose to use proxy passthrough to make:

http://www.site.com/2004/05/file.ext

actually show:

http://serv2.site/content/2004/05/file.ext

and keeping the URL intact.. but when putting this into practice I keep getting a 400 bad request :/

(the '(.+){3})' is there for a reason by the way, there are other rewrites in place for if the file paramater is not given)

Iv tried
Code: Select all
RewriteRule   ^/([0-9]{4})/([0-9]{2})/((.+){3})/ http://serv2.site/content/$1/$2/$3  [PT]
but has not helped, the rule gets ignored..

Any pointers would be great appreciated and I would also like to know any pros/cons with using [PT] to include content from an external server, im not sure if using this for files will cause adverse affects on apache :/

Cheers all,
BP
Guest
 

Postby Caterham » Fri Dec 10, 2004 1:47 pm

Code: Select all
RewriteRule  ^([0-9]{4})/([0-9]{2})/((.+){3}) http://serv2.site/content/$1/$2/$3  [P]
:P
--> P = proxy-Flag
--> Slash removed at end of search string


Bob
Caterham
 
Posts: 690
Joined: Fri Dec 10, 2004 1:30 pm


Return to Friendly URLs with Mod_Rewrite

Who is online

Users browsing this forum: No registered users and 20 guests

cron