I’m trying to get the following effect:
- A user visits example.com/profile/Tom and it, in the background, makes it example.com/profile.php?username=Tom
- Instead of making line after line of .htaccess for each URL (Figure 1), I want it to be short and work nicely, e.g. the user visits example.com/about and it uses about.php, then example.com/helloworld and it uses helloworld.php
As right now, I have to put the following for each URL I want, and instead I want 2-3 lines of .htaccess that would do the job. (If possible, more is fine, I’m not great with .htaccess)
RewriteRule ^login/submit$ login.php?action=submit
Try this and let me know.
Here’s the full documentation about the
[]flags: http://httpd.apache.org/docs/2.3/rewrite/flags.html