.htaccess 301 redirect on /index.html file redirects subdomain /index.html file.

Asked by:
neslho / 5 Points
Time:
2012-10-13 4:02 pm EST
Category:
Htaccess
Hits:
1,481
I have a 301 redirect on the homepage of danohlsen.com like this:
redirect 301 /index.html http://danohlsen.com/projects/

I have a subdomain dev.danohlsen.com located at:
/dev

It seems I cannot access dev.danohlsen.com/index.html because of the redirect I setup for /index.html. Is there a way to setup the 301 redirect to only affect danohlsen.com/index.html and not dev.danohlsen.com/index.html?

To ask this user for more information, please first login.

To submit an answer, please login.

ANSWERS

0

johnpaulb-whh2
Staff
9,290 Points
2012-10-15 9:03 am EST
Hello neslho,

Thank you for your question regarding .htaccess rewrite. It sounds like the .htaccess is affecting the folders below it, you can avoid this by creating a new .htaccess file in the /dev folder, and turning the rewrite engine off in the new .htaccess.

This will cause the new .htaccess to override the rules created in the original one.

If you have any further questions, feel free to post them below.
Thank you,

-John-Paul

To submit a comment on this answer, please first login.

Want to share this Question?

Related Articles

It looks like there are no related articles.
Would you like to ask a question about this page? If so, click the button below!

Help Center Search

Current Customers

Email: support@WebHostingHub.com Ticket: Submit a Support Ticket
Call: 877-595-4HUB (4482)
757-416-6627 (Intl.)
Chat: Click To Chat Now

Ask the Community

Get help with your questions from our community of like-minded hosting users and Web Hosting Hub Staff.

Not a Customer?

Get web hosting from a company that is here to help.