I have this kind of URL:
http://www.example.com/index.php?page=contest&contest=this-one-contest
i'm trying to get 2 functioning urls here.
What I'm trying to do is to get this kind of URL:
Which is already done using this htaccess rewrite rule
RewriteRule ^([a-z_-]+)/([a-zA-Z0-9_-]+)$ index.php?page=$1 [L,QSA]
RewriteRule ^([a-z_-]+)$ index.php?page=$1 [L,QSA]
RewriteRule ^([a-z_-]+)/$ index.php?page=$1 [L,QSA]
What I'm trying to do is to get this kind of URL in the second URL:
I don't Know if this is even possible using htaccess, and I don't want to create a new folder called "contest".
I have tried this already, but it's not still working.
RewriteRule ^([a-z_-]+)contest/([a-zA-Z0-9_-]+)$ index.php?page=$1&contest=$2 [L,QSA]
RewriteRule ^([a-z_-]+)contest/$ index.php?page=$1 [L,QSA]
RewriteRule ^([a-z_-]+)contest/$ index.php?page=$1 [L,QSA]
I finally found a work around that works for me, i made lot's of self tweak to @arkascha solution,
RewriteEngine on
RewriteRule ^/?([a-z_-]+)/([a-zA-Z0-9_-]+)/?$ /index.php?page=$1&contest=$2 [L,QSA]
RewriteRule ^([a-z_-]+)/$ index.php?page=$1 [L,QSA]
RewriteRule ^/?contest/?$ /index.php?contest=1$ [L,QSA]