Forum Moderators: phranque
New member here, so profuse apologies if this particular situation has been covered before (I did use search, to no avail).
Here's the problem: I have a site, www.mydomain.com that runs using traditional PHP and MySQL. However, I've successfully installed Zope on my server, that can currently be accessed by the long and complicated www.mydomain.com:8080/vhosts/mydomain.com/dev
Not ideal.
I'd like to use apache's redirect functionality in order to be able to type something like dev.mydomain.com, or www.mydomain.com/dev (either is acceptable - it's just for my own benefit) and have it resolve to the address above.
I've tried experimenting with .htaccess (it's an Apache server) to accomplish this, but without success. (Bear in mind I'm not exactly an expert!) Here's what I have so far:
Options +FollowSymlinks
RewriteEngine On
RewriteBase /
# Rewrite Rule for dev.mydomain.com
RewriteCond %{HTTP_HOST} dev\.mydomain\.com$
RewriteCond %{REQUEST_URI}!mydomain.com:8080/vhosts/mydomain.com/dev
Rewriterule (.*)$ /dev/$1
Please pull this apart. I'm aware I've got no clue, so laughing is quite alright! :)
Thanks for your time...this site has always been a great help to me.
Welcome to WebmasterWorld [webmasterworld.com]!
It looks like your second RewriteCond is trying to test information it does not have access to, specifically the requested hostname and the port number.
I suspect you'll need to use three RewriteConds, one for the %{HTTP_HOST}, one for the %{SERVER_PORT}, and one for the 'real domain name' part passed in %{REQUEST_URI}. Also, don't end-anchor your %{HTTP_HOST} pattern with "$" -- that often cause problems.
Jim