0

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?

3
  • You can search on Google, I just found on Stack Overflow the answer to your question.
    – Zistoloen
    Commented Feb 22, 2014 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
    Commented Feb 22, 2014 at 9:52
  • Or are you wanting to --write to your .htaccess file using PHP??
    – MrWhite
    Commented Mar 13, 2015 at 16:42

1 Answer 1

0

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

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