Page 1 of 1

Create a nice looking php link, is this possible ?

Posted: Wed Jan 11, 2006 9:54 am
by Claudia007
I started recently with php.
I can create a small database BUT I have a question regarding the website-links.

For instance.
the website link for my webpage, created with php is

http://www.testclaudia.com/pictures.php?id=4

I want for example: http://www.testclaudia.com/4

Is this possible ?

IT WOULD BE GREAT.

Thanks for your help and assistance.
CLAUDIA>

Posted: Wed Jan 11, 2006 9:55 am
by hawleyjr
Neither of those links workl :?

Posted: Wed Jan 11, 2006 10:01 am
by Nathaniel
They aren't supposed to, hawleyjr.

Create an .htaccess file in the folder pictures.php is in, and put this code in the .htaccess file:

Code: Select all

RewriteEngine On
RewriteRule ^([0-9]+)$ /pictures.php?id=$1
Unless your host has disabled htaccess files, that should work.

Posted: Wed Jan 11, 2006 4:11 pm
by Claudia007
Dear Nathaniel,

thanks for this code.
It would be great if it works. I will try it.

I will tell you.

Best regards,
Claudia.

Posted: Wed Jan 11, 2006 6:07 pm
by John Cartwright
If it doesn't, you may have to enable to module for mod_rewrite (which is the name of what this is) in apache

Posted: Thu Jan 12, 2006 5:31 am
by foobar
Jcart wrote:If it doesn't, you may have to enable to module for mod_rewrite (which is the name of what this is) in apache
...in your httpd.conf file.