Web Server Configuration
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsWeb DesignWeb Server Configuration

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old October 5th, 2005, 05:51 AM
robcurry01 robcurry01 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2005
Posts: 2 robcurry01 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 44 m 8 sec
Reputation Power: 0
rewrite only php files?

Hi Guys,

I am very new to mod rewrite and need some advice/code.

I need to do a rewrite but only when the script requested is a .php file i.e. it needs to leave any htm, html etc files alone.

If its any easier, is it possible to ignore "index.htm" and rwrite everything else?

i have had a quick look about but cannot work it out. Any help would be appreciated.

Thanks,

Rob

Reply With Quote
  #2  
Old October 5th, 2005, 05:59 AM
infamous-online infamous-online is offline
Moderator
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Posts: 404 infamous-online User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 24 m 44 sec
Reputation Power: 7
ok what exactly are you trying to do? i am confused as to what you're trying to do here?
__________________
Apache Expert

Reply With Quote
  #3  
Old October 5th, 2005, 06:06 AM
robcurry01 robcurry01 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2005
Posts: 2 robcurry01 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 44 m 8 sec
Reputation Power: 0
ok, the situation is this.

A client has transferred there website to a different server. There is a .htaccess file which contains a couple of rewrite rules, which seem to re-direct everything to an index.php file.

The rule is as follows:

RewriteRule ^([qwertyuopasdfghjklzxcvbnmQWERTYUOPASDFGHJKLZXCVBNM Ia-e])(.*)$ index.php?url=$0&%{QUERY_STRING}

This is having a strange effect on the index.htm file which is a holding page. All images, even though they are there, will not display. When i remove the rule they work, meaning that the rule is doing something to the image request.

I need a way to keep the rule in place but get it to run only if the URL is NOT index.htm ... if you understand that?

i.e:

http://www.domain.com/index.htm = do not rewrite
http://www.domain.com/*.* = rewrite

Hope this has clarified something!

Reply With Quote
  #4  
Old October 5th, 2005, 06:51 AM
Itsacon's Avatar
Itsacon Itsacon is offline
Command Line Warrior
Click here for more information
 
Join Date: Aug 2004
Location: Sector ZZ9 Plural Z Alpha
Posts: 995 Itsacon User rank is Lance Corporal (50 - 100 Reputation Level)Itsacon User rank is Lance Corporal (50 - 100 Reputation Level)Itsacon User rank is Lance Corporal (50 - 100 Reputation Level)  Folding Points: 797501 Folding Title: Super Ultimate Folder - Level 2Folding Points: 797501 Folding Title: Super Ultimate Folder - Level 2Folding Points: 797501 Folding Title: Super Ultimate Folder - Level 2Folding Points: 797501 Folding Title: Super Ultimate Folder - Level 2Folding Points: 797501 Folding Title: Super Ultimate Folder - Level 2Folding Points: 797501 Folding Title: Super Ultimate Folder - Level 2Folding Points: 797501 Folding Title: Super Ultimate Folder - Level 2
Time spent in forums: 6 Days 13 h 57 m 35 sec
Reputation Power: 5
Send a message via ICQ to Itsacon
What the request does, is send every query the server gets, as a variable to the index.php file.
Probably, the index.php file is then supposed to output the proper data, but apparently, it doesn't know how to output images (maybe the headers are wrong).
filtering out index.htm won't solve the problem for other pages with images, best way is probably to fix the index.php so it does what it should do.
__________________
This is my code. Is it not nifty?

"The biggest problem encountered while trying to design a system that was completely foolproof, was, that people tended to underestimate the ingenuity of complete fools."
---Douglas Adams


Join the Itsacon fanclub!    
Zero Tolerance: Spammers banned so far: 275

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsWeb DesignWeb Server Configuration > rewrite only php files?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT