Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Website and Server Administration Forum


You are currently viewing our Website and Server Administration Forum as a guest. Please register to participate.
Login



Reply
complex apache RewriteCond
Old 12-23-2009, 08:56 AM complex apache RewriteCond
Junior Talker

Posts: 1
Trades: 0
Here's what I'm trying to do with our webserver...

If a requested file does not exist and is not a directory or if it is a directory but there is no index.php file, I want to apply a specific rewrite rule.

In my httpd.conf, I've figured out the simple part of

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^js/(.*)$ /javascript/system/$1 [L, QSA]

The problem comes with the part about if the directory exists but there not being an index.php file. In that case I also want to apply the RewriteRule, but it doesn't let me do something like

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} -d && %{REQUEST_FILENAME}/index.php !-f
RewriteRule ^js/(.*)$ /javascript/system/$1 [L, QSA]

Can someone help me?
jistanidiot is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 12-24-2009, 02:32 AM Re: complex apache RewriteCond
joebert's Avatar
Novice Talker

Posts: 5
Name: joe
Location: Clearwater, FL USA
Trades: 0
I think you're going to need two rewriterules.

I'd try this for starters.

Code:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}/index.php !-f
RewriteRule ^js/(.*)$ /javascript/system/$1 [L, QSA]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^js/(.*)$ /javascript/system/$1 [L, QSA]
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
joebert is offline
Reply With Quote
View Public Profile Visit joebert's homepage!
 
Reply     « Reply to complex apache RewriteCond
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.20468 seconds with 12 queries