I've set up Apache virtual hosting on port 8080 to suggest to my magento website.

        Listen 8080

        <VirtualHost 6x.2x.6x.1x:8080>

    ServerAdmin webmaster@localhost
    ServerName domainname.com
ServerAlias *.domainname.com
DocumentRoot /var/www/sites/domain/

    <Directory />
            Options FollowSymLinks
            AllowOverride all
            Order allow,deny
            allow from all
    </Directory>

    ErrorLog /var/log/apache2/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog /var/log/apache2/access.log combined
    ServerSignature On

<LocationMatch ".*\svn.*">
    Order allow,deny
    Deny from all
</LocationMatch>

           </VirtualHost>

After i visit the website www.domain.com:8080 the js, css, img along with other situations are not loaded since the port isn't connected to the links

This is a rewrite rule in magento .htaccess that doesn't appear to operate:

         <IfModule mod_rewrite.c>

############################################
## enable rewrites

    Options +FollowSymLinks
    RewriteEngine on

############################################
## you can put here your magento root folder
## path relative to web root

    #RewriteBase /magento/

############################################
## workaround for HTTP authorization
## in CGI environment

    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

############################################
## always send 404 on missing files in these folders

    RewriteCond %{REQUEST_URI} !^/(media|skin|js)/

############################################
## never rewrite for existing files, directories and links

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-l

############################################
## rewrite everything else to index.php
    RewriteCond %{SERVER_PORT} !^8080$
    RewriteRule .* http://6x.2x.6x.1x:8080/index.php [L]

       </IfModule>

Is Rewrite-mod the best means to fix run magento site on different port? If so, where's my mistake in the present Rewrite rule?

thanks,

Margots

I haven't attempted it (becaus I'd rather not kill my Shop), however i think you can easily alter the Port within the Magento Admin.

In System / Configuration / Web / Base URL. Just consider adding the main harbour towards the URL there. Does that actually work?

You cannnot rewrite a URL that Magento creates in it's HTML Output using mod_rewrite. The Request towards the wrong URL (with no :8080 Port) will not even achieve your server.

UPDATE:

Consider the Supply of the HTML output (i.E. see your Shop together with your Webbrowser and press Control-U or whatever). Do tags such as the following possess the correct URL, such as the port?

<script type="text/javascript" src="http://yourstore.com:8080/js/prototype/prototype.js"></script>