0

Please I am working on a payment portal where vendors register to accept payments from customers. The issue is that vendors are suppose to have a link in this format;

www.mypaymentsite.com/vendor_username

At first i thought it was about rewriting

www.mypaymentwebsite.com?id=vendor_username 

to

www.mypaymentwebsite.com/vendor_username

using .htaccess file but I realised that the page vendor_username has to exist as i already have an index page which is the homepage of my website.

Please I know I am missing something, but what is the best way to create dynamic pages like www.mypaymentwebsite.com/vendor_username for each vendor registered on my site.

Thanks a lot.

Aravindh Gopi
  • 2,083
  • 28
  • 36
  • 4
    `page 'vendor_username' has to exist` - why? – Iłya Bursov Jul 25 '17 at 20:43
  • if you are getting stuck at this point of your application I would not be placing or accepting payments though your site, take a step back read some tutorials on this and on best security practices. – cmorrissey Jul 25 '17 at 20:45
  • Please make sure you *do* understand how rewriting works exactly, see the duplicate. Nothing needs to actually exist anywhere. If that doesn't clear it up enough, please refine your question. – deceze Jul 25 '17 at 20:46

1 Answers1

1

You can create a route that catches vendors when they visit. This route can utilize the username. The route would show something like

mypaymentwebsite.com/vendor/{username}

This is a handy feature found in most frameworks, like Laravel. It is possible to set it up yourself, but takes time. You can't (or at least not easily) create dynamic websites using filenames as the url. You need routes that return data in views. Look up Model View Controller, or MVC programming.

parker_codes
  • 3,267
  • 1
  • 19
  • 27