PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > php.general > Remove index.php from url
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Remove index.php from url

Réponse
 
LinkBack Outils de la discussion
Vieux 11/10/2008, 17h37   #1
OOzy Pal
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Remove index.php from url

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 ?

--
OOzy
Ubuntu-Gutsy (7.10)

  Réponse avec citation
Vieux 11/10/2008, 17h50   #2
Shawn McKenzie
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Remove index.php from url

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 ?
>

mod_rewite if you use Apache. In the simplest form (not tested):

..htaccess

RewriteRule ^index\.php\/(.*)$ $1 [L,NC,NS]

HTH
-Shawn
  Réponse avec citation
Vieux 11/10/2008, 18h02   #3
Shawn McKenzie
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Remove index.php from url

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 ?
>>

> 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
  Réponse avec citation
Vieux 11/10/2008, 18h44   #4
Ashley Sheridan
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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 ?
> >>

> > 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.


Ash
www.ashleysheridan.co.uk

  Réponse avec citation
Vieux 11/10/2008, 19h00   #5
\Crash\ Dummy
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Re: Remove index.php from url

> 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.


On IIS, the default document(s) are set on the server. If index.php is
not in the default document list, and you don't have access to the
server, I don't know how to override the default except by
redirecting.
--
Crash
Committed to the search for intraterrestrial intelligence.



  Réponse avec citation
Vieux 11/10/2008, 19h10   #6
Ashley Sheridan
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] Re: Re: Remove index.php from url

On Sat, 2008-10-11 at 13:00 -0400, "Crash" Dummy wrote:

> > 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.

>
> On IIS, the default document(s) are set on the server. If index.php is
> not in the default document list, and you don't have access to the
> server, I don't know how to override the default except by
> redirecting.
> --
> Crash
> Committed to the search for intraterrestrial intelligence.
>
>
>
>


That wasn't what I was asking. I meant is there an equivalent to
mod-rewrite for IIS? I've got bunches of pages being sourced from one
php file, and i'd like to be able to accept URLs without the querystring
part, but still have access to those querystring variables in my php
code.


Ash
www.ashleysheridan.co.uk

  Réponse avec citation
Vieux 11/10/2008, 19h56   #7
Richard Heyes
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] Re: Remove index.php from url

> mod_rewite if you use Apache.

Or, if you don't have it (not very likely), directories. Eg For the
URL you gave, make a dir called company and put a default document in
there (usually index.html). You will end up with a trailing slash on
the URL, and it does incur a redirect, but it works. This might even
work with IIS, so it would be cross-server compatible.

--
Richard Heyes

HTML5 Graphing for FF, Chrome, Opera and Safari:
http://www.rgraph.org
  Réponse avec citation
Vieux 11/10/2008, 20h02   #8
\Crash\ Dummy
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Re: Re: Remove index.php from url

> That wasn't what I was asking. I meant is there an equivalent to
> mod-rewrite for IIS?


No. At least nothing simple and free. Run a Google search for
"mod_rewrite iis" and you will see what I mean.
--
Crash
Committed to the search for intraterrestrial intelligence.



  Réponse avec citation
Vieux 11/10/2008, 22h34   #9
Spacefish
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Remove index.php from url

why do you run php things on a windows box anyway?
Use a proper linux 2.6 ;-). It´s free it´s fast it saves
you money and it has MUCH MORE FEATURES!
-------------------------------------
visit my webpage http://www.howhot.de

OOzy Pal schrieb:
> 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 ?
>

  Réponse avec citation
Vieux 12/10/2008, 01h55   #10
jason php
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] Re: Re: Re: Remove index.php from url

I think what you're looking at is one of a myriad of available ISAPI
plug-ins; essentially, an IIS add-on that mimics the functionality of
mod_rewrite to some degree.

I found one that claims to work on IIS 5.0-7.0 *and* appears to be FREE.
Problem is, you won't be able to simply copy over any existing .htaccess
files: http://www.codeplex.com/IIRF

Another interesting find was one that advertises 100% compatibility between
it and Apache .htaccess files. It, however, costs a few bucks:
http://www.micronovae.com/ModRewrite/ModRewrite.html

Jason

I haven't used either one of these myself, so I can't provide you with
anything more concrete... Hope this s!

On Sat, Oct 11, 2008 at 2:02 PM, Crash Dummy <gmane@thedatalist.com> wrote:

> > That wasn't what I was asking. I meant is there an equivalent to
> > mod-rewrite for IIS?

>
> No. At least nothing simple and free. Run a Google search for
> "mod_rewrite iis" and you will see what I mean.
> --
> Crash
> Committed to the search for intraterrestrial intelligence.
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


  Réponse avec citation
Vieux 12/10/2008, 11h23   #11
Ashley Sheridan
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] Re: Remove index.php from url

On Sat, 2008-10-11 at 18:56 +0100, Richard Heyes wrote:

> > mod_rewite if you use Apache.

>
> Or, if you don't have it (not very likely), directories. Eg For the
> URL you gave, make a dir called company and put a default document in
> there (usually index.html). You will end up with a trailing slash on
> the URL, and it does incur a redirect, but it works. This might even
> work with IIS, so it would be cross-server compatible.
>
> --
> Richard Heyes
>
> HTML5 Graphing for FF, Chrome, Opera and Safari:
> http://www.rgraph.org
>


Thanks everyone, I'll look into these in a bit more depth when I get
back into work tomorrow.


Ash
www.ashleysheridan.co.uk

  Réponse avec citation
Vieux 12/10/2008, 20h08   #12
Nathan Rixham
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] Re: Re: Remove index.php from url

Ashley Sheridan wrote:
> That wasn't what I was asking. I meant is there an equivalent to
> mod-rewrite for IIS?


old one but ISAPI Rewrite is the pretty much standard implementation
  Réponse avec citation
Vieux 13/10/2008, 15h54   #13
Boyd, Todd M.
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut RE: [PHP] Re: Remove index.php from url

> -----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 ?
> > >>
> > > 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
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 20h08.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,24581 seconds with 21 queries