Solved

Setup Apache Mod_Rewrite

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

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…
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

862 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

22 Experts available now in Live!

Get 1:1 Help Now