Forum Moderators: phranque
http://www.website.com/index.php?lang=en&act=art http://www.website.com/index.php?act=con&lang=fr http://www.website.com/index.php?language=english&page=articles http://www.website.com/index.php?language=french&page=contact #RewriteCond %{QUERY_STRING} act=(.*)
#RewriteRule ^index.php(.*) /index.php?page=%1 [R] http://www.website.com/index.php?act=pre&lang=fr http://www.website.com/index.php?language=francais&page=articles index.php' to appear in the URL. In particular, /index.php?language=francais&page=articles is implementation detail that does not need to be exposed to users. I'd look at using extensionless URLs with a format like example.com/francais/articles feeding a rewrite to fetch the content from the script. #4 strings = sorted categories for articles etc.
RewriteRule ^public_html/subdir/(.*)/(.*)/(.*)/(.*)/$ /subdir/index.php?language=$1&page=$2&sort=$3&id=$4
#3 strings = specific articles
RewriteRule ^public_html/subdir/(.*)/(.*)/(.*)/$ /subdir/index.php?language=$1&page=$2&read=$3
#2 strings = language specific pages
RewriteRule ^public_html/subdir/(.*)/(.*)/$ /subdir/index.php?language=$1&page=$2
#1 string = any page in english
RewriteRule ^public_html/subdir/(.*)/$ /subdir/index.php?language=english&page=$1 http://www.website.org.uk/index.php?act=&lang=en http://www.website.org.uk/index.php?act=&lang=fr http://www.website.org.uk/index.php?act=&lang=de http://www.website.org.uk/index.php?act=&lang=es http://www.website.org.uk/index.php?act=&lang=it http://www.website.org.uk/index.php?act=&lang=sv http://www.website.org.uk/index.php?act=&lang=no http://www.website.org.uk/index.php?lang=en http://www.website.org.uk/index.php?act=pre&lang=en http://www.website.org.uk/index.php?act=art&lang=en http://www.website.org.uk/index.php?act=faq&lang=en http://www.website.org.uk/index.php?act=hlp&lang=en http://www.website.org.uk/index.php?act=con&lang=en http://www.website.org.uk/index.php?ref=&lang=en http://www.website.org.uk/index.php?ref=&lang=en&act=pre http://www.website.org.uk/index.php?ref=&lang=en&act=art http://www.website.org.uk/index.php?ref=&lang=en&act=faq http://www.website.org.uk/index.php?ref=&lang=en&act=hlp http://www.website.org.uk/index.php?ref=&lang=en&act=con http://www.website.org.uk/index.php?ref=&lang=en&act=err http://www.website.org.uk/content/empty.php http://www.website.org.uk/index.php?lang=fr http://www.website.org.uk/index.php?act=pre&lang=fr http://www.website.org.uk/index.php?act=art&lang=fr http://www.website.org.uk/index.php?act=faq&lang=fr http://www.website.org.uk/index.php?act=hlp&lang=fr http://www.website.org.uk/index.php?act=con&lang=fr http://www.website.org.uk/index.php?ref=&lang=fr http://www.website.org.uk/index.php?ref=&lang=fr&act=pre http://www.website.org.uk/index.php?ref=&lang=fr&act=art http://www.website.org.uk/index.php?ref=&lang=fr&act=faq http://www.website.org.uk/index.php?ref=&lang=fr&act=hlp http://www.website.org.uk/index.php?ref=&lang=fr&act=con http://www.website.org.uk/index.php?ref=&lang=fr&act=err http://www.website.org.uk/index.php?lang=de http://www.website.org.uk/index.php?act=pre&lang=de http://www.website.org.uk/index.php?act=art&lang=de http://www.website.org.uk/index.php?act=faq&lang=de http://www.website.org.uk/index.php?act=hlp&lang=de http://www.website.org.uk/index.php?act=con&lang=de http://www.website.org.uk/index.php?ref=&lang=de http://www.website.org.uk/index.php?ref=&lang=de&act=pre http://www.website.org.uk/index.php?ref=&lang=de&act=art http://www.website.org.uk/index.php?ref=&lang=de&act=faq http://www.website.org.uk/index.php?ref=&lang=de&act=hlp http://www.website.org.uk/index.php?ref=&lang=de&act=con http://www.website.org.uk/index.php?ref=&lang=de&act=err http://www.website.org.uk/index.php?lang=es http://www.website.org.uk/index.php?act=pre&lang=es http://www.website.org.uk/index.php?act=art&lang=es http://www.website.org.uk/index.php?act=faq&lang=es http://www.website.org.uk/index.php?act=hlp&lang=es http://www.website.org.uk/index.php?act=con&lang=es http://www.website.org.uk/index.php?ref=&lang=es http://www.website.org.uk/index.php?ref=&lang=es&act=pre http://www.website.org.uk/index.php?ref=&lang=es&act=art http://www.website.org.uk/index.php?ref=&lang=es&act=faq http://www.website.org.uk/index.php?ref=&lang=es&act=hlp http://www.website.org.uk/index.php?ref=&lang=es&act=con http://www.website.org.uk/index.php?ref=&lang=es&act=err http://www.website.org.uk/index.php?lang=it http://www.website.org.uk/index.php?act=pre&lang=it http://www.website.org.uk/index.php?act=art&lang=it http://www.website.org.uk/index.php?act=faq&lang=it http://www.website.org.uk/index.php?act=hlp&lang=it http://www.website.org.uk/index.php?act=con&lang=it http://www.website.org.uk/index.php?ref=&lang=it http://www.website.org.uk/index.php?ref=&lang=it&act=pre http://www.website.org.uk/index.php?ref=&lang=it&act=art http://www.website.org.uk/index.php?ref=&lang=it&act=faq http://www.website.org.uk/index.php?ref=&lang=it&act=hlp http://www.website.org.uk/index.php?ref=&lang=it&act=con http://www.website.org.uk/index.php?ref=&lang=it&act=err http://www.website.org.uk/index.php?lang=sv http://www.website.org.uk/index.php?act=pre&lang=sv http://www.website.org.uk/index.php?act=art&lang=sv http://www.website.org.uk/index.php?act=faq&lang=sv http://www.website.org.uk/index.php?act=hlp&lang=sv http://www.website.org.uk/index.php?act=con&lang=sv http://www.website.org.uk/index.php?ref=&lang=sv http://www.website.org.uk/index.php?ref=&lang=sv&act=pre http://www.website.org.uk/index.php?ref=&lang=sv&act=art http://www.website.org.uk/index.php?ref=&lang=sv&act=faq http://www.website.org.uk/index.php?ref=&lang=sv&act=hlp http://www.website.org.uk/index.php?ref=&lang=sv&act=con http://www.website.org.uk/index.php?ref=&lang=sv&act=err http://www.website.org.uk/index.php?lang=no http://www.website.org.uk/index.php?act=pre&lang=no http://www.website.org.uk/index.php?act=art&lang=no http://www.website.org.uk/index.php?act=faq&lang=no http://www.website.org.uk/index.php?act=hlp&lang=no http://www.website.org.uk/index.php?act=con&lang=no http://www.website.org.uk/index.php?ref=&lang=no http://www.website.org.uk/index.php?ref=&lang=no&act=pre http://www.website.org.uk/index.php?ref=&lang=no&act=art http://www.website.org.uk/index.php?ref=&lang=no&act=faq http://www.website.org.uk/index.php?ref=&lang=no&act=hlp http://www.website.org.uk/index.php?ref=&lang=no&act=con http://www.website.org.uk/index.php?ref=&lang=no&act=err http://www.website.org.uk/content/languageBuild.php?lang=en http://www.website.org.uk/index.php?act=err&lang=en http://www.website.org.uk/index.php?act=err&lang=fr http://www.website.org.uk/index.php?act=err&lang=de http://www.website.org.uk/index.php?act=err&lang=es http://www.website.org.uk/index.php?act=err&lang=it http://www.website.org.uk/index.php?act=err&lang=sv http://www.website.org.uk/index.php?act=err&lang=no ([^/]+) or similar will parse a LOT faster. #RewriteRule (.+)\.php$ index.php #RewriteCond %{QUERY_STRING} Term=([a-zA-Z]*)
#RewriteRule ^test\.php$ /test?%1 #RewriteCond %{QUERY_STRING} ^&act=pre$
#RewriteRule ^index\.php$ /francais/press/%1 #RewriteCond %{QUERY_STRING} act=(.*)
#RewriteRule ^index.php(.*) /index.php?page=%1 [R]
RewriteCond %{QUERY_STRING} (^|&)act=pre(&|$)
RewriteRule ^index\.php$ /english/press/ [edited by: jdMorgan at 4:19 pm (utc) on Apr 16, 2010]
[edit reason] example.com, disabled smilies in code [/edit]
http://www.website.org.uk/index.php?act=&lang=sv to http://www.website.org.uk/svenska/home/ http://www.website.org.uk/index.php?act=hlp&lang=en to http://www.website.org.uk/english/help/ http://www.website.org.uk/index.php?ref=&lang=es&act=pre to http://www.website.org.uk/espanol/press/ http://www.website.org.uk/index.php?act=faq&lang=no to http://www.website.org.uk/norsk/faq/ [edited by: jdMorgan at 12:16 am (utc) on Apr 17, 2010]
[edit reason] Disabled smilies in code. [/edit]
RewriteCond %{QUERY_STRING}>english ^([^&]*&)*lang=en(&[^&>]*)*>(.+)$ [OR]
RewriteCond %{QUERY_STRING}>francais ^([^&]*&)*lang=fr(&[^&>]*)*>(.+)$ [OR]
RewriteCond %{QUERY_STRING}>deutch ^([^&]*&)*lang=de(&[^&>]*)*>(.+)$ [OR]
RewriteCond %{QUERY_STRING}>espanol ^([^&]*&)*lang=es(&[^&>]*)*>(.+)$ [OR]
RewriteCond %{QUERY_STRING}>italiano ^([^&]*&)*lang=it(&[^&>]*)*>(.+)$ [OR]
RewriteCond %{QUERY_STRING}>svenska ^([^&]*&)*lang=sv(&[^&>]*)*>(.+)$ [OR]
RewriteCond %{QUERY_STRING}>norsk ^([^&]*&)*lang=no(&[^&>]*)*>(.+)$
RewriteRule ^index\.php$ - [E=qLang:%3,C]
#
RewriteCond %{QUERY_STRING}>press ^([^&]*&)*act=pre(&[^&>]*)*>(.+)$ [OR]
RewriteCond %{QUERY_STRING}>articles ^([^&]*&)*act=art(&[^&>]*)*>(.+)$ [OR]
RewriteCond %{QUERY_STRING}>faq ^([^&]*&)*act=faq(&[^&>]*)*>(.+)$ [OR]
RewriteCond %{QUERY_STRING}>help ^([^&]*&)*act=hlp(&[^&>]*)*>(.+)$ [OR]
RewriteCond %{QUERY_STRING}>contact ^([^&]*&)*act=con(&[^&>]*)*>(.+)$ [OR]
RewriteCond %{QUERY_STRING}>error ^([^&]*&)*act=err(&[^&>]*)*>(.+)$ [OR]
RewriteCond %{QUERY_STRING}>emg ^([^&]*&)*act=emg(&[^&>]*)*>(.+)$
RewriteRule ^index\.php$ http://www.example.com/%{ENV:qLang}/%3/? [R=301,L]
http://www.website.org.uk/%{ENV:qLang}/%3/? [R=301,L] http://www.website.org.uk/%3/? [R=301,L] http://www.website.org.uk/%3/home/? [R=301,L] http://www.website.org.uk/$1 [R=301,L] http://%{HTTP_HOST}/$1$2/ [L,R=301] [edited by: jdMorgan at 1:04 am (utc) on Apr 18, 2010]
[edit reason] Disabled smilies in code [/edit]
RewriteCond %{HTTP_HOST} ^website\.org.uk$would be better coded as
RewriteCond %{HTTP_HOST} [b]![/b]^[b](www\.[/b]website[b]\[/b].org[b]\[/b].uk[b])?[/b]$