You are here: Re: Making a PHP program look like a directory. « PHP Programming Language « IT news, forums, messages
Re: Making a PHP program look like a directory.

Posted by Chris Hope on 08/24/05 23:02

Frederic Wenzel wrote:

> Chris Hope schrieb:
>
>> If you're on Apache you can either use mod_rewrite or set the
>> application type like so:
>>
>> (...)
>> application type:
>> <Location /myprog>
>> ForceType application/x-httpd-php
>> </Location>
>>
>> In the case of setting the application type you'd create the php
>> script without a filename extension (ie so it's just called
>> "myprog"). I personally prefer to use mod_rewrite but have used the
>> other method in the past.
>
> In fact, you should avoid this if possible. It's quite "dirty" as you
> can't see that it's a php file anymore and you have to do this for
> every location you want to use. Mod_rewrite is much more flexible.

Which is part of the reason I don't use it anymore. When I first started
using that method I don't think I was aware of mod_rewrite

There is another method I have used which allows you to keep the
filename extension on the original file, using aliases, and you can
still make it "look like a directory":

Alias /foo /path/to/foo.php

> There are servers that don't have it enabled though. In this case I
> can see why you used it.

I've always hosted the sites I do this sort of stuff on on my own
servers, or servers I manage. But as I mentioned I wasn't originally
aware of mod_rewrite or the power and flexibility you have with it. The
other nice thing with mod_rewrite is you don't have to bother writing
code to parse the uri.

--
Chris Hope | www.electrictoolbox.com | www.linuxcdmall.com

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация