I'm trying to get the following effect:
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.
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^profile/([^/])/? profile.php?username=$1 [L,NC]
RewriteRule ^login/submit$ login.php?action=submit [L,NC]
# /login/ will go to login.php or /contact/ will go to contact.php
RewriteRule ^([a-z0-9_\-]+)/? $1.php [L,NC]
Here's the full documentation about the [] flags: http://httpd.apache.org/docs/2.3/rewrite/flags.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With