views:

28

answers:

2

Hey there,

I'm trying to change all http://www.mysite.com/filename.php files to show as http://www.mysite.com/filename/ using mod_rewrite, but I seem to be doing something wrong.

Can anyone help out? I'm guessing it's something pretty simple for those that know. Thanks.

A: 

Try this:

RewriteEngine On
RewriteRule ^(.+)\.php$ $1/ [L,QSA]
MiffTheFox
Hey there,Yeah, but that sends the site.com/filename/ to site.com/filename.php, I need one the other way around, is that even possible?
Dirge2000
@Dirge - Oh, I see now... Changed it.
MiffTheFox
That's just the job. I've got another rule interfering with it, but if I try that on its own, it works, and hence is correct. :)
Dirge2000
+1  A: 

An awesome, simple, copy, paste style tutorial http://www.workingwith.me.uk/articles/scripting/mod_rewrite

used2could