?
Solved

HTACCESS - MOD REWRITE - HELP

Posted on 2006-11-09
2
Medium Priority
?
370 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 2000 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 does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
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…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

752 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