Julian Hansen
asked on
.htaccess passing through non existent extension
I am having one of those developer moments where I am not seeing the obvious.
I have an .htaccess file that does two things
Either sends requests of the type
http://domain/service/blah/blah/blah => service.php?args=$1
Failing that everything is sent to index.php
All works - except for one small thing - the args passed to service .php starts with .php so using the above example service.php receives
I have an .htaccess file that does two things
Either sends requests of the type
http://domain/service/blah/blah/blah => service.php?args=$1
Failing that everything is sent to index.php
All works - except for one small thing - the args passed to service .php starts with .php so using the above example service.php receives
.php/blah/blah/blah
Instead of
blah/blah/blah
The rewrite rule for service is as follows
RewriteRule ^service(.*)$ service.php?args=$1 [L,NC,QSA]
What am I missing? Why the .php prefix?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks Dave for the response.
The /service option won't work on my side - I am using a RewriteBase directive so all my rules are relative to that - but appreciate the feedback.
The /service option won't work on my side - I am using a RewriteBase directive so all my rules are relative to that - but appreciate the feedback.
Glad you got it figured out anyway.
ASKER
Found the solution on my own
Open in new window
http://www.askapache.com/htaccess/htaccess.html#Htaccess_File_Syntax