Change URL Address make short in PHP
25,973
Solution 1
You'll want to use mod_rewrite, a module available in apache. This will be managed by an .htaccess file within your web directory. AddedBytes has a nice tutorial for beginners on url-rewriting.
See: http://www.addedbytes.com/for-beginners/url-rewriting-for-beginners/
Solution 2
You can do this in at least 2 different ways:
- Use mod_rewrite for Apache to map the SEO friendly URL to your querystring based URL.
- Make
/ab
a php script that inspects thePATH_INFO
to retrieve/jenny
. You'll have to configure Apache to treat scripts with no extension as php scripts for this to work.
![Admin](/assets/logo_square_200-5d0d61d6853298bd2a4fe063103715b4daf2819fc21225efa21dfb93e61952ea.png)
Author by
Admin
Updated on February 27, 2020Comments
-
Admin over 4 years
I have Url as:
localhost/ab/directory.php?id=200
id=200 is jenny id member
how to change it to
localhost/ab/jenny
is possible?
Thanks