I need some help to accomplish .htaccess URI rewriting...
I tried to write some of .htaccess code myself but could do that only for the limited version of URI, like: http://whateversubdomain.site.com/ transforms into http://whateversubdomain.site.com/index ... rsubdomain
- Code: Select all
RewriteEngine On
# Rewrite www.domain.com to domain.com
RewriteCond %{HTTP_HOST} ^www.(.*)
RewriteRule ^(.*) http://%1/$1 [R=302,L]
# Rewrite subdomain.domain.com to
# subdomain.domain.com/index.php/subdomain
# but do not show /index.php/subdomain
RewriteCond %{HTTP_HOST} ^(.*)\.(.*)\.(ru|com|nl|eu)$
RewriteRule ^$ %{HTTP_HOST} [C]
RewriteRule ^((.*)\.(.*)\.(ru|com|nl|eu)) http://$1/index.php/$2 [QSA,L]
But the task is:
If user types in something like that:
http://whateversubdomain.site.com/somet ... parameterN
I'd like the URL to remain the same but server to execute something like that:
http://whateversubdomain.site.com/index ... parameterN
So, basically my problem is how to pass /something2/parameter1/parameter2/parameterN from the original URI into rewritten one...?
Btw, wilcard DNS is turned on.
Thank you very much in advance,
Mikhail