Reputation: 81
Hi guys i'm trying to apply a rule on my htaccess :
I made a MVC framework (OOP) in php .
RewriteRule ^([A-Za-z]+)/([A-Za-z]+)/([0-9]+)$ ?module=$1&action=$2&id=$3 [L,QSA]
RewriteRule ^([a-z]+)/([a-zA-Z]+)$ ?module=$1&action=$2 [L,QSA]
Where module is the name of the controller and action is the function of the controller.
Example of url : http://mywebsite.com/ads/sell
How can i write http://mywebsite.com/contact instead of http://mywebsite.com/page/contact with a rule in my htaccess.
I dont have a router class
Upvotes: 0
Views: 77
Reputation: 7476
Try this one
RewriteRule ^([a-zA-Z]+)$ ?module=page&action=$1 [L]
comment if have any error issue
Upvotes: 1