Hello forums !!
I am bored with working with the url with query string urls ie("http://localhost/my_project/index.php?page=test&action=create").
Now i would like to work with clean urls like "http://localhost/my_project/test/create"
I would like to rewrite the url without using mod_rewrite module rather i would like to use PHP.
How to explode the urls to get the required parameters ?
Note: I am working under the my_project folder
Any comments n suggestions are warmly welcome.
Thanks in advance to all of you.
making clean urls using PHP ??
I don't think PHP could do it, as somehow the web server has to know what file to send the request to.
Ok then plz let me know.
i had the following case:
if i had the following url: http://localhost/my_project/test/create
I would to map this url with http://localhost/my_project/index.php?url=/test/create/
So that its easier to retrieve the params using $_GET['url'] and everything will go fine.
How it could be achieved using mod_rewrite? thanks in advance.
RewriteEngine on
RewriteRule ^my_project/([^/]+)/([^/]+)/?$ my_project/index.php?page=$1&action=$2
nope its not working..
Do you know if your Apache configuration has the rewrite_module enabled (the following line uncommented in httpd.conf -- at least on my PC)?
LoadModule setenvif_module modules/mod_setenvif.so
how to enable $_SERVER['PATH_INFO'], it says undefined index PATH_INFO.