Forum Moderators: phranque
Weclome to WebmasterWorld!
Use RewriteCond [httpd.apache.org] %{SERVER_PORT} to test for NOT port 80, and if so, 301-redirect all requests to your canonical URL using [R=301,L] on the RewriteRule.
Jim
For some useful references and more information on our policies, see our forum charter [webmasterworld.com]. At the very least, reading the mod_rewrite and regular-expressions reference material and taking a shot at coding a solution will get you conversant with the terminology and techniques.
The only difference between your application and the simple redirection examples in the documentation is what I posted above -- you'll need to test the port number and only do the redirect if it is not port 80.
If you don't want to try to do it yourself, then you could post in our commercial exchange [webmasterworld.com] forum for bids.
Jim
RewriteEngine on
RewriteCond %{SERVER_PORT}!^80$
RewriteRule ^/(.*) [ourdomain.com...] [L,R]
Now I've tried this in the httpd.conf file, restarted Apache, as well as trying this in an .htaccess file and it does not appear to work. We did have 'Listen 80' so I simply added 'Listen 8000' and with the redirect rule it works so thanks for your suggestions.
Other than that, your code looks fine.
Jim