Solved

Setup Apache Mod_Rewrite

Posted on 2009-06-30
2
206 Views
Last Modified: 2012-05-07
Mod Rewrite is a bear. I want to do this

URL typed into browser http://www.dilithiumtoys.com/
Return http://www.dilithiumtoys.com/?sessionkey=blah or URL returned as text from custom filter

I have two filters in between though. Mod Security and a custom one. The Custom one generates the sessionkey or sends back the url that should be fetched.

I guess I would like to know is how to pass the URL generated by another filter to mod rewrite?
0
Comment
Question by:dilithiumtoys
2 Comments
 
LVL 51

Accepted Solution

by:
ahoffmann earned 500 total points
ID: 24753351
RewriteRule ^/*$ /?sessionkey=blah [L]
0
 

Author Comment

by:dilithiumtoys
ID: 24761676
How would I rewrite what I have? SecRule ENV:InfDoCmd "@eq Redirect" phase:2,nolog,redirect:%{ENV.InfDoVal}

I am only doing a redirect if the custom module tells mod_security to do so. I can change the custom filter to return a URL to follow always if that is required.

Currently if the user request meets the rules, we just pass the request along. There are no redirect or other type of actions below the statement above.

so entry to http://www.dilithiumtoys.com currently works in this way:

User is in China: redirect to http://www.dilithiumtoys.com/?e=601
User is looking for a bad directory: redirect to http://www.dilithiumtoys.com?e=401
User Passes: Do Nothing

Would I do this?
RewriteRule ^/*$ {ENV.SomeURL} [L]

Thanks in Advance

0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

If you are running a LAMP infrastructure, this little code snippet is very helpful if you are serving lots of HTML, JavaScript and CSS-related information. The mod_deflate module, which is part of the Apache 2.2 application, provides the DEFLATE…
It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video discusses moving either the default database or any database to a new volume.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now