Solved

simple htaccess RewriteEngine question

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Stream live video from Raspberry Pi camera 22 159
Wordpress "chart" plugin recommendation 7 52
ASP.NET MVC 2 31
Please help me find a theme close to these two themes....... 9 52
Envision that you are chipping away at another e-business site with a team of pundit developers and designers. Everything seems, by all accounts, to be going easily.
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

777 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