Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I'm looking for step by step resource about how to rewrite URLs and have a few specific questions.

I've read the documentation on mod_rewrite in Apache, but I still find myself a little lost.

  1. If I have example.com/products.html, can I change this to appear as example.com/products? For that to happen, do I make all of my links point to /products and then have a rewrite rule that directs /products to /products.html? Or is it the other way around?

  2. Also, for PHP forms, I've noticed that I can't have a form action that points to a directory: for example, it requires /mail/index.php instead of just /mail.

Can mod_rewrite fix this too?

share|improve this question
3  
Yes, mod_rewrite can do both things. Relevant: Everything You Ever Wanted to Know about Mod_Rewrite Rules but Were Afraid to Ask? –  Pekka 웃 Nov 20 '11 at 10:52

1 Answer 1

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.