Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My site is an e-commerce site. All URLs are dynamic, like "my_domain/a.php", "my_domain/a.php?id=1", "my_domain/b.php", "my_domain/b.php?id=3", etc.

I want static URLs like "my_domain/a.html","my_domain/b.html","my_domain/c.html", "my_domain/d.html", etc.

I am little weak in the .htaccess file. What do I add to my .htaccess file o achieve that result?

share|improve this question

I've been looking for an answer similar to this question for a while now.

For something like your example, you could do:

RewriteEngine On
RewriteRule ^([^/]*)$ /testpage.php?id=$1 [L]

I found this website this morning which helps to generate these re-write rules

it's output was:

The original URL:
The rewritten URL:
share|improve this answer

Your Answer


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.