Just wonder how to do a rule for this:
I have a page like this:
index.php?s=$1&$2&page=$3
For example it can be:
index.php?s=sp&alla&page=1
where
$1 represent the "main page" wich is sp
$2 represent wich type of genre it is (any form om $_GET)
$3 represents wich page it is in the pagination function..
I just wonder how to do so the link (index.php?s=$1&$2&page=$3) can be ruled so the visible linkpath(the friendly URL) will look something like this:
www.mypage.com/spel/<genre here>/<pagenumber here>.html
The rest of my rules looks like this:
- Code: Select all
RewriteEngine On
# /azplund --> /index.php?s=medlem&v=azplund
RewriteRule ^([a-z_][-a-z_]+)$ /index.php?s=medlem&v=$1 [NC,QSA,L]
# /azplund/fotoalbum --> /index.php?s=medlem&v=azplund&show=nagonsida
RewriteRule ^([a-z_][-a-z_]+)/([a-z_][-a-z_]+)$ /index.php?s=medlem&v=$1&show=$2 [NC,QSA,L]
# /azplund/fotoalbum --> /index.php?s=medlem&v=azplund&show=nagonsida&album=visanågotalbum
RewriteRule ^([a-z_][-a-z_]+)/([a-z_][-a-z_]+)/([a-z_0-9][-a-z_0-9]+)$ /index.php?s=medlem&v=$1&show=$2&album=$3 [NC,QSA,L]
# /nagon_typ_av_sida/ --> /index.php?s=nagon_typ_av_sida
RewriteRule ^([A-Za-z0-9\_][A-Za-z0-9\_\-]+)(/)?$ index.php?s=$1 [NC,QSA,L]
# <--------------- THIS IS THE ONE I WANT TO REPLACE ------------->
#/spel_eller_filmer/genre/sida --> /index.php?s=filmer&alla&page=nagon_sida
RewriteRule ^([a-zA-Z\_]+)/([a-zA-Z\_]+)/([0-9]+) index.php?s=$1&$2&page=$3 [NC,QSA,L]
# <--------------- // THIS IS THE ONE I WANT TO REPLACE ------------->
# /spela/spelet.html --> /index.php?s=spela&spelet=nagot_namn_pa_spelet
RewriteRule ^spela/(.+)\.html$ /index.php?s=spela&spelet=$1 [NC,QSA,L]
# /fullskarm/spelet.html --> /fullskarm.php?spelet=nagot_namn_pa_spelet
RewriteRule ^fullskarm/(.+)\.html$ /fullskarm.php?spelet=$1 [NC,QSA,L]
# /film/filmens_namn.html --> /index.php?s=visa_film&film=namnet_pa_filmen_komer_har
RewriteRule ^film/(.+)\.html$ /index.php?s=visa_film&film=$1 [NC,QSA,L]
Is it possible to do this at all?
Nice day!
/azplund