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

Link to comment
Share on other sites

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

 

 

Link to comment
Share on other sites

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."

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.