Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Setup Apache Mod_Rewrite

Posted on 2009-06-30
2
Medium Priority
?
214 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 1500 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

Create the perfect environment for any meeting

You might have a modern environment with all sorts of high-tech equipment, but what makes it worthwhile is how you seamlessly bring together the presentation with audio, video and lighting. The ATEN Control System provides integrated control and system automation.

Question has a verified solution.

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

If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
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…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

719 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