0

How would I do this please? I am having problems with my htaccess.

suppose I have this url:

www.testingstackzz.com/index.php?action=list&lcp=19 

and I want to redirect it to a custom url which I made up like this

www.testingstackzz.com/general/place

where 'place' in the above url is the name for the variable lcp=19 in the database. So lcp=20 would be another place to be more explicit.

Cœur
  • 37,241
  • 25
  • 195
  • 267

1 Answers1

0

In your index.php script, look for the $_GET['lcp'] parameter, look it up in the database, then use header("Location: /general/$name_of_place");

If you only want to limit this to request that directly access the index.php file, then check the $_SERVER['REQUEST_URI'].

Jon Lin
  • 142,182
  • 29
  • 220
  • 220