|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
ok what exactly are you trying to do? i am confused as to what you're trying to do here?
![]()
__________________
Apache Expert |
|
#3
|
|||
|
|||
|
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! |
|
#4
|
||||
|
||||
|
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
![]() |
![]() |
| Viewing: Dev Articles Community Forums > Web Design > Web Server Configuration > rewrite only php files? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|