Jump to content

rewrite or hide url in php xampp


vinpkl

Recommended Posts

You'll need to use a .htaccess file.

 

Have you ever used one before?

 

It will require a mod_rewrite

 

hi gevans

 

yes i know it will be done by creating  .htaccess file in vineet folder that is in my htdocs. but i dont know what to write in it.

 

and i have already uncommented mod-rewrite in apache httpd.conf

 

vineet

I think this should work for you;

 

RewriteEngine on
RewriteRule ^products.php?/([a-zA-Z0-9_=\&]+)$ products [L]

 

hi gevans

 

i used ur code in my htaccess file that i have in vineet folder.

 

then i stoped the apache and restart it.

 

but it still giving me the complete url with

http://localhost/vineet/products.php?dealer_id=9&category_id=1

 

and if i write

localhost/vineet/products

in  the adress bar it gives me error 404 object not found.

 

do i need to do any other settings.

 

vineet

 

 

You are in luck! Now that you know it is the mod_rewrite, a little googling pulls up:

 

http://www.webmastertips.us/tutorials/mod_rewrite.htm

 

and all results

 

http://www.google.com/search?hl=en&q=mod_rewrite+htaccess&btnG=Search

 

 

I would suggest doing some reading to get it exactly how you want it, just as the old saying goes,

 

"You can feed a man for a day by giving him a fish, or feed a man for life by teaching him how to fish."

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.