Solved

Problem with mod_rewrite.

Posted on 2007-03-28
1
165 Views
Last Modified: 2010-03-04
Need some help with mod_rewrite... Can not seem to get this to work.

RewriteCond %{REQUEST_URI} ^/foo/one|two|three/.+$ [NC]
RewriteRule ^/foo/(a-z)/?$ "/press/$1/bar" [NC]

Trying to say... if someone goes to /foo/(either one, two, or three)/
then go to /foo/x/bar

Perhaps it could all be done without a RewriteCond
0
Comment
Question by:qwertq
1 Comment
 
LVL 11

Accepted Solution

by:
JamesCssl earned 250 total points
ID: 18812905
RewriteRule ^/?foo/(one|two|three)/bar/?$ /foo/$1/bar [NC]


In your initial RewriteCond, You needed parenthesis to set off the middle section like:
RewriteCond %{REQUEST_URI} ^/foo/(one|two|three)/.+$ [NC]
0

Featured Post

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Join & Write a Comment

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…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

759 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

19 Experts available now in Live!

Get 1:1 Help Now