Solved

simple htaccess RewriteEngine question

Posted on 2007-11-29
2
541 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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Suggested Solutions

Learn by example how to specify CSS selectors for Selenium WebDriver test automation software.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
This video teaches users how to migrate an existing Wordpress website to a new domain.

735 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