I have the following in my .htaccess file (minus that “1.”, which I have no idea why that was added because I used the code block to insert the htaccess code–which is what I thought I needed to do?):
[LIST=1]
[*]RewriteEngine On
RewriteBase /
RewriteCond %{REMOTE_ADDR} !^127\\.0\\.0\\.1
RewriteCond %{REMOTE_ADDR} !^149\\.102\\.45\\.147
RewriteCond %{REMOTE_ADDR} !^149\\.102\\.45\\.83
RewriteCond %{REQUEST_URI} !/projects/abc_wiki$
RewriteRule .* /projects/calendar.abc.edu [R=302,L]
rewritecond %{http_host} ^localhost.abc.edu [nc]
rewriteRule ^(.*)$ http://localhost:8080/www/projects/calendar.abc.edu/$1 [r=301,nc]
[/LIST]
I’m not sure how to exactly word this, so bear with me here…
I need to make my browser forward localhost.calendar.edu to 127.0.0.1 where I have WAMP and UltiDev running to handle both PHP and ASP stuff. This, I have working… But how can I make all “localhost.calendar.edu” browser requests be forwarded to the sub-directory of “www/projects/calendar.abc.edu” and make that sub-directory appear to have localhost.calendar.edu as its domain name? So for example, if I’m on my workstation browsing to www/index.php, the domain name would probably be something like “http://localhost/index.php”, but what I want to do is have “http://localhost.calendar.edu” when I’m browsing for “localhost.calendar.edu” from within www/projects/calendar.abc.edu. (I’m trying to set my sub-directory to use its own exclusive domain, but I’m not sure if this is being worded correctly to explain what I’m trying to do here.)
In my HOSTS file, I have “localhost.calendar.edu” assigned to 127.0.0.1, so now whenever I travel to localhost.calendar.edu, I at least get forwarded to my www root. This is correct: I can see my domain in the address bar and everything is working. But now I need to do something with .htaccess. I think it’s called a “rewrite” (and not a redirect) despite Firefox telling me that the redirect will never succeed–for reasons I can’t understand yet. I think a problem to consider here with this is how Apache will offload the request into :8080, which is being handled by UltiDev (the ASP server I have running).
(My understanding of .htaccess code / syntax isn’t that great, so any input / insight into what I’m trying to do here is very appreciated.)
Note: The reason I’m trying to do all this is because I’m working on some legacy ASP installations and I’m just trying to test for specific domain names in my scripts. I’m trying to build a file-level process to handle specific URL requests. I’m working on something IIS-related from a production environment that has forced us to resort to this approach due to how various virtual directories / bindings have been configured through IIS–which I despise, FWIW.