Solved

Setup Apache Mod_Rewrite

Posted on 2009-06-30
2
208 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
CentOS 7 (Apache2) Cannot Install SSL Cert 1 61
LAMP problem identifier tool ? 9 118
Apache 2.2 on Windows 2008 32 76
apache vhosts on mac not being recognized 5 84
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…
Over the last year I have answered a couple of basic URL rewriting questions several times so I thought I might as well have a stab at: explaining the basics, providing a few useful links and consolidating some of the most common queries into a sing…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

772 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