troubleshooting Question

Mod_Rewrite Condition to Redirect External Referrers

Avatar of Brahmanatha
Brahmanatha asked on
Apache Web ServerWeb ComponentsWeb Applications
6 Comments1 Solution300 ViewsLast Modified:
We inflate   EPUB's on our web site in advance, save them to e.g.

/public_html/media/books/#some-book-title#/web/ops/xhtml/some-page1.html

We then use LiveCode - RevIgniter to serve these inside an iFrame, inside our site wrapper.. this works great.

BUT  the  problem is Google is finding these pages, indexing and caching them and they are linked to and delivered outside our site wrapper. e.g.

http://dev.himalayanacademy.com/media/books/merging-with-siva/web/ops/xhtml/part_2ch_34a.html

I need to create a mod_rewrite condition that will redirect these to our CMS

in pseudo-code it would look like

IF
( RewriteCond $1 ^(media/books/[any string here, some reg ex I presume]/web/ops)  ) AND (referrer IS NOT localhost)
THEN
RewriteRule ^(.*)$ index.lc?/$1 [L]  
END IF

can you help me with the proper mod_rewrite rule for this?

Thanks!
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 6 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros