Solved

HTACCESS - MOD REWRITE - HELP

Posted on 2006-11-09
2
366 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
[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 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
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…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

705 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