htaccess help

I inherited a website that uses an htaccess file that's simply over my head...

I have a development environment setup in a subdomain, but it appears that all requests are getting re-directed back to the main directory. How can I setup an exclusion for my subdomain so that all development requests (e.g. "dev.domain.com") bypass these rules?

Urgent! Thanks.

htaccess-example.txt
sjl570Asked:
Who is Participating?
 
arober11Connect With a Mentor Commented:
Hi

Add your sub-domain to the following rule:

# Additional condition
RewriteCond %{HTTP_HOST} !^DEV-SUB-DOMAIN\.domain\.com [NC] 
#
RewriteCond %{HTTP_HOST} !^domain\.com [NC] 
RewriteRule ^(.*)$ http://domain.com/$1 [R=301,L]

Open in new window


Then strip or replace with http://%{HTTP_HOST} all the http://domain.com strings from the RewriteRule lines e.g.

RewriteRule ^login/ http://domain.com/Security/login [L,R=301]
#Becomes:
RewriteRule ^login/     /Security/login [L,R=301]
# Or Alternitively
RewriteRule ^login/     http://%{HTTP_HOST}/Security/login [L,R=301]

Open in new window

0
 
sjl570Author Commented:
I'm no expert, but it looks like this should work. We're coming across some strange cache-related issues that are confusing the situation, so I can't verify whether this solves the problem. A work in progress... I appreciate your time - and hopefully this will help others in the same situation. Thanks!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.