Solved

HTACCESS - MOD REWRITE - HELP

Posted on 2006-11-09
2
308 Views
Last Modified: 2010-03-04
I am using a mod rewrite to convert a url w/ a query string to a more friendly format.

Example:
http://www.mydomain.com/value/index.php
is interpereted by the server as:
http://www.mydomain.com/index.php?variable=value

The previous part is working.
The problem comes when trying to access a folder off of the web root.

Example:
http://www.mydomain.com/admin/login.php
The server is interpertiing this as:
http://www.mydomain.com/login.php?variable=admin

I need help modifying the .htaccess below to exclude certian values so I can access sub-folders.

Example:
admin
images
css
include

# Begin .htaccess
RewriteEngine on
RewriteRule ^([^/]+)/([^/]+)\.php$ /$2.php?variable=$1
RewriteRule ^([a-zA-Z0-9_-]+)$ /index.php?variable=$1
RewriteRule ^([a-zA-Z0-9_-]+)/$ /index.php?variable=$1
0
Comment
Question by:MrPickle
2 Comments
 
LVL 16

Accepted Solution

by:
HackneyCab earned 500 total points
ID: 17911011
I solved this problem for another member a few weeks ago:

http://www.experts-exchange.com/Web/Web_Languages/PHP/Q_22033545.html

You need to use a RewriteCond to check whether the directory exists before executing the RewriteRule.
0
 

Author Comment

by:MrPickle
ID: 17929794
Thanks, that was exactly what I needed.
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

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…
In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

747 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

12 Experts available now in Live!

Get 1:1 Help Now