Apache Server configuration support - Redirect / ReWrite only for the root

This is Interesting: Free IT Magazines  
Home > Archive > Apache Server configuration support > February 2006 > Redirect / ReWrite only for the root





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Redirect / ReWrite only for the root
Rich

2006-02-26, 11:24 am

Hi.. I thought I had a handle on this RewriteRule stuff, but am having
an issue.
I've read through the FAQs and the group, but can't figure this
specific one out. Forgive me if it is simple...

I want to redirect all requests to http://www.abcde.com (or
http://www.abcde.com/) to http://www.xyz.com

But, I want users to be able to access specific pages under
www.abcde.com -- i.e., a request for
http://www.abcde.com/subdir/somePage.html should be allowed.

RewriteRule ^/ http://www.xyz.com
sends every request to www.xyz.com


Any suggestions?

Thanks!

Robert Ionescu

2006-02-26, 11:24 am

Rich wrote:
> I want to redirect all requests to http://www.abcde.com (or
> http://www.abcde.com/)


This is absolutely the same, there is no difference. The browser will
start a GET request like

GET / HTTP/1.1

> RewriteRule ^/ http://www.xyz.com
> sends every request to www.xyz.com


Yes, mark the end of the string with a $ sign:

RewriteRule ^/$ http://www.xyz.com [R=301,L]

--
Robert
Rich

2006-02-26, 11:24 am

Thanks, Robert. The $ eluded me.

All fixed now.

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com