How do I solve this with mod_rewrite ?

New to mod_rewrite? This is a good place to start.

How do I solve this with mod_rewrite ?

Postby mat_gluber » Tue Apr 21, 2009 3:39 pm

I want to achieve the following with mod_proxy and mod_rewrite.
Ill use youtube as an example here.

1. User's browser is setup for proxy via my Apache proxy server.

2. User requests for a youtube page say http://www.youtube.com/watch?v=hN5avIvylDw

3. The requests goes through my proxy and an html page is returned which contains the url for the main video (something like)
http://www.youtube.com/get_video?video_ ... NDsqb682F& etc .

I want to redirect just the link for this main video to a diff domain say
http://www.mydomain.com/get_video?video ... NDsqb682F&
preserving the cgi params.

Whatever I try with "RewriteRule" only works on the main url typed in by the user, but not in the URL's embedded in the html page that is returned.
Any hints on how to solve this is appreciated?
mat_gluber
 
Posts: 2
Joined: Tue Apr 21, 2009 3:22 pm

Postby richardk » Tue Apr 21, 2009 4:39 pm

Mod_rewrite only works on incoming "browser" type requests. It does not change anything inside HTML pages.
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby mat_gluber » Tue Apr 21, 2009 9:09 pm

Thanks Richard. Can you suggest any tools which could help me acheive this?
Cheers
mat_gluber
 
Posts: 2
Joined: Tue Apr 21, 2009 3:22 pm

Postby richardk » Wed Apr 22, 2009 4:40 am

mod_proxy_html or maybe a Filter. I have never used wither, though.
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am


Return to Beginner's Corner

Who is online

Users browsing this forum: Google [Bot] and 9 guests

cron