Webmasters Stack Exchange is a question and answer site for pro webmasters. 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

This question already has an answer here:

How to rewrite my URL from http://www.mysite.com/listingsecond.php?ID=1 to http://www.mysite.com/listingsecond?

How can I rewrite to my .htaccess in PHP to do this?

share|improve this question

marked as duplicate by John Conde Feb 22 '14 at 13:33

This question was marked as an exact duplicate of an existing question.

    
You can search on Google, I just found on Stack Overflow the answer to your question. – Zistoloen Feb 22 '14 at 9:50
    
what you want is to redirect without using .htaccess? If that is what you want, my answer may help, if that is not what you want, please clarify the question a bit. – PatomaS Feb 22 '14 at 9:52
    
Or are you wanting to --write to your .htaccess file using PHP?? – w3dk Mar 13 '15 at 16:42

On your PHP file, use the $_GET variable to process the query as you need, then when generating the response, redirect to the address that you want using the header function. Specifically, the location attribute

share|improve this answer

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