Solved

simple htaccess RewriteEngine question

Posted on 2007-11-29
2
547 Views
Last Modified: 2013-12-08
Currently I am using this

RewriteEngine on
RewriteCond %{HTTP_HOST} ^hello.xxx.net$ [OR]
RewriteCond %{HTTP_HOST} ^www.hello.xxx.net$
RewriteRule ^(.*)$ http://www.xxx.net/hello$1 [R=301,L]

This will redirect my visitors even they have typed in http://hello.xxx.net/anything
I only wish to redirect "hello.xxx.net", but not http://hello.xxx.net/WHATEVER

Whats the correct code?
Thanks
0
Comment
Question by:LearningLearning
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 43

Accepted Solution

by:
ravenpl earned 500 total points
ID: 20372878
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} ^hello.xxx.net$ [OR]
RewriteCond %{HTTP_HOST} ^www.hello.xxx.net$
RewriteRule ^$ http://www.xxx.net/hello [R=301,L]
#last rule says, that redirection should trigger only if there's nothing except "/" in url path
0
 

Author Closing Comment

by:LearningLearning
ID: 31411616
excellent
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An enjoyable and seamless user experience can go a long way on an eCommerce site. While a cohesive layout and engaging copy play roles in creating a positive user experience, some sites neglect aspects that seem marginal but in actuality prove very …
Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

718 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question