0

i m trying to figure out how to do this i know in php if we have some folder and inside that if we have index.php then calling that folder location from url will serve index.php file but problem is my path changes for example

  xxyz.com/edit/2343
     xxyz.com/edit/2347
   xxyz.com/edit/2342

i cant serve with edit.php?2343 etc i have to serve like that only how can i direct php to serve inde.php file when we call xxyz.com/edit/2347 these url scheme i guess with htaccess we can do this

ritika
  • 1
  • 1
  • Are you asking how to use rewrite rules or what is the question? You shouldn't have numerous `index.php` files if that is what you currently are doing. – user3783243 Feb 02 '23 at 11:51
  • how to serve these request without crating multiple index.php file for all those nbers , i guess yes htacess rule wil solve – ritika Feb 02 '23 at 11:52
  • `edit/(\d+)` rewrite to `index.php?page=edit&id=$1` then read GET values of `page` and `id`. That's 1 way. There are many ways to do this. Research mod-rewrite. See https://stackoverflow.com/questions/20563772/reference-mod-rewrite-url-rewriting-and-pretty-links-explained – user3783243 Feb 02 '23 at 11:57

0 Answers0