RE: [PHP] Re: Remove index.php from url
| From: | Boyd, Todd M. | Date: | Mon, 13 Oct 2008 13:54:05 +0000 |
| Subject: | RE: [PHP] Re: Remove index.php from url | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-281795@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: Ashley Sheridan [mailto:ash@ashleysheridan.co.uk]
> Sent: Saturday, October 11, 2008 11:44 AM
> To: Shawn McKenzie
> Cc: php-general@lists.php.net
> Subject: Re: [PHP] Re: Remove index.php from url
>
> On Sat, 2008-10-11 at 11:02 -0500, Shawn McKenzie wrote:
> > Shawn McKenzie wrote:
> > > OOzy Pal wrote:
> > >> Hello,
> > >>
> > >> I expect that this question been beaten to death. I googled for
> many hours
> > >> and all what I found is related to one CMS or another. I want to
> do is to
> > >> make a very very very simple index.php that when is it called it
> > >> automatically detect the page and load it. For example, when I
> call
> > >>
> > >> www.xyz.com/index.php/company, it calls for company.html. I have
> made that
> > >> index.php. Now I need to remove this index.php from the url.
> > >>
> > >> Can you help?
> > >>
> > > mod_rewite if you use Apache. In the simplest form (not tested):
> > >
> > > .htaccess
> > >
> > > RewriteRule ^index\.php\/(.*)$ $1 [L,NC,NS]
> > >
> > > HTH
> > > -Shawn
> > Scrub that. The rule is backwards. But mod_rewrite is the answer.
> >
> > -Shawn
> >
> Incidentally, does anyone know how this would be achieved on IIS?
We've
> got a site at work that's running off a CMS I knocked up, but they'd
> prefer the URLs to look proper, without the query string.
http://www.codeplex.com/IIRF - Ionic ISAPI Rewrite Filter
It's free under the Ms-PL (Microsoft Permissive License), and uses
Regular Expressions. Took me a while of rooting through crappy URL
filters that charge $500+ just for RegEx functionality to find this gem.
I've tested it in a few different situations here at work, and it does
the job.
HTH,
Todd Boyd
Web Programmer