Anybody available good with htaccess and mod rewrite - i want your help!

I have to rewrite the bottom a part of a url.

for instance all requestst to will need to go to

The demands will typically maintain the shape the following:

then i will need to go to

Pleas help!

Thanks ahead of time

Spinning URL's across multiple domain names? I am unsure of this could work, thinking about Apache's request-handling formula. You are searching for a redirect, not rewrite.

Do this inside your .htaccess file:

Options +FollowSymLinks
RewriteEngine on

# redirect for http
RewriteCond %{HTTP_HOST} ^domain1\.com$ [NC]  
RewriteCond %{SERVER_PORT} =80
RewriteRule ^/?(.*)$$1 [R=301,QSA,L,NE]

# redirect for https
RewriteCond %{HTTP_HOST} ^domain1\.com$ [NC]  
RewriteCond %{SERVER_PORT} =443
RewriteRule ^/?(.*)$$1 [R=301,QSA,L,NE]

R=301 will redirect with https status 301
L can make last rule
NE is perfect for no getting away query string
QSA will append your overall query parameters

$1 is the REQUEST_URI