Solved

Setup Apache Mod_Rewrite

Posted on 2009-06-30
2
212 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

In my time as an SEO for the last 2 years and in the questions I have assisted with on here I have always seen the need to redirect from non-www urls to their www versions. For instance redirecting http://domain.com (http://domain.com) to http…
As Wikipedia explains 'robots.txt' as -- the robot exclusion standard, also known as the Robots Exclusion Protocol or robots.txt protocol, is a convention to prevent cooperating web spiders and other web robots from accessing all or part of a websit…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

624 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