baconbeastnz Posted June 11, 2009 Share Posted June 11, 2009 Hi there, I want to change all URL's which go www.mysite.com/{anything}.php?action=register to -> www.mysite.com/register I've tried my best, but it is not working. RewriteRule ^([A-Za-z0-9-]+)\.php\?action=([A-Za-z0-9-]+)$ /$2 Any help appreciated. Link to comment https://forums.phpfreaks.com/topic/161820-mod-rewrite-help/ Share on other sites More sharing options...
dreamwest Posted June 12, 2009 Share Posted June 12, 2009 RewriteRule ^([A-Za-z0-9-]+)\.php\?action=([A-Za-z0-9-]+)$ /$2 Yeah thats funny, trying to rewrite by direct url.. RewriteRule ^register/ anything.php?action=register [L,QSA] Link to comment https://forums.phpfreaks.com/topic/161820-mod-rewrite-help/#findComment-854303 Share on other sites More sharing options...
baconbeastnz Posted June 13, 2009 Author Share Posted June 13, 2009 Do you know how to make this work for every pattern it encounters? e.g so we could send 10 vars over URL's and have them all change format ?= -> / / Link to comment https://forums.phpfreaks.com/topic/161820-mod-rewrite-help/#findComment-855101 Share on other sites More sharing options...
dreamwest Posted June 13, 2009 Share Posted June 13, 2009 RewriteRule ^([^/\.]+)?/?$ anything.php?action=register [L,QSA] So fake urls like: http://site.com/register http://site.com/hello http://site.com/something http://site.com/else Will all go to anything.php?action=register Link to comment https://forums.phpfreaks.com/topic/161820-mod-rewrite-help/#findComment-855162 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.