Forum Moderators: phranque
RewriteRule ^([a-zA-Z0-9_-]*)/(.*?)\.html(.*?)$ phpfile.php?file=$2&lang=$1$3 [L] RewriteCond %{SERVER_PORT} ^443$
RewriteCond %{REQUEST_URI} !^.*?lang/usessl.html*
RewriteRule ^(.*) http://%{HTTP_HOST}/$1 [L,R=301] example.com//.html to be a valid request. Use + in place of * in the first pattern and ([^/.]+) in place of (.*?) in the second pattern.
#SSL
RewriteCond %{SERVER_PORT} !^443$
RewriteCond %{REQUEST_URI} ^/lang/usessl\.html(.*)$
RewriteRule ^(.+) https://%{HTTP_HOST}/$1 [R=301,L]
RewriteCond %{SERVER_PORT} ^443$
RewriteCond %{REQUEST_URI} !^/lang/usessl\.html(.*)$
RewriteRule ^(.+) http://%{HTTP_HOST}/$1 [R=301,L]
RewriteRule ^([a-zA-Z0-9_-]+)/(.+)\.html(.*)$ phpfile.php?file=$2&lang=$1$3 [L]
>RewriteRule can see only the path part of the request.
I guess, that's not true.
example.com/foo/bar.html/somestuff example.com/foo/bar.html?somestuff RewriteRule ^([a-zA-Z0-9_-]+)/(.+)\.html phpfile.php?file=$2&lang=$1 [QSA,L] RewriteBase / html(.*?)$
RewriteCond %{REQUEST_URI} ^/blahblah
the following rule does not work because of missing query data: