Page 1 of 1

Create Virtual Directory...

PostPosted: Tue Aug 27, 2013 10:26 am
by David de Argentina
Hi all,

I have a hosting under Linux with cPanel.
I have a php program that is called as:

http://www.mysite.com/myprogram.php?user=JohnDoe

Is possible transform this url to something like:

http://www.mysite.com/JohnDoe/

JohnDoe is a key to search an user into a Database, not a directory.

Any ideas ?

Thanks in advance,
David de Argentina

Re: Create Virtual Directory...

PostPosted: Tue Aug 27, 2013 10:40 am
by dec
Hello,

Search on Google for something like "friendly urls htaccess php". I think can be useful here. ;)

Re: Create Virtual Directory...

PostPosted: Tue Aug 27, 2013 10:59 am
by David de Argentina
Hi dec,

Excelent !

Thanks a bunch !
David de Argentina

Re: Create Virtual Directory...

PostPosted: Tue Aug 27, 2013 12:09 pm
by dec
David de Argentina wrote:Hi dec,

Excelent !

Thanks a bunch !
David de Argentina


You're welcome! ;)

Re: Create Virtual Directory...

PostPosted: Tue Aug 27, 2013 3:06 pm
by David de Argentina
Hi dec,

It works perfectly.

Take a look of this url:

http://www.neoregalos.com.ar/clientes/Garcia

PHP program and variables are hidden !

WOW !

Greetings from Buenos Aires,
David de Argentina

Re: Create Virtual Directory...

PostPosted: Tue Aug 27, 2013 4:30 pm
by dec
Hello,

The "htaccess" way is used in WordPress and many other PHP CMS systems. This is good, but, in fact is possible to deal with more or less user friendly URL's without the use of any kind of "htaccess" files. For example, the approach I use in my HummPHP project do not use any "htaccess" file, but, as you can see, they have more or less friendly URL's like this:

http://www.hummphp.com/?contact

http://neoplugins.com/?plugin/nputil

http://neoplugins.com/?help/nputil

... and so on. As you can see this URL's are not exactly the sames (at the least use the "?" char) but more friendly's that, for example, this others:

http://neoplugins.com/?plugin=nputil

http://neoplugins.com/?help=nputil

http://neoplugins.com/?help=nputil&other=value

By the way probably you can use the "htaccess" files without problems. The question is if you use this kind of files need the Apache server, or any other server that can work directly or more or less adapted "htaccess" file. So if you do not use this files you do not depend (for this) on any particular server.