|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
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) |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
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 |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
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 |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
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 |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
> 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. |
|
|
|
#6 |
|
Messages: n/a
Hébergeur: |
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 |
|
|
|
#7 |
|
Messages: n/a
Hébergeur: |
> 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 |
|
|
|
#8 |
|
Messages: n/a
Hébergeur: |
> 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. |
|
|
|
#9 |
|
Messages: n/a
Hébergeur: |
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 ? > |
|
|
|
#10 |
|
Messages: n/a
Hébergeur: |
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 > > |
|
|
|
#11 |
|
Messages: n/a
Hébergeur: |
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 |
|
|
|
#12 |
|
Messages: n/a
Hébergeur: |
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 |
|
|
|
#13 |
|
Messages: n/a
Hébergeur: |
> -----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 |
|
![]() |
| Outils de la discussion | |
|
|