Redirect / ReWrite only for the root
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Apache Server configuration support > Redirect / ReWrite only for the root




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Redirect / ReWrite only for the root  
Rich


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
02-26-06 04:24 PM

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!






[ Post a follow-up to this message ]



    Re: Redirect / ReWrite only for the root  
Robert Ionescu


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
02-26-06 04:24 PM

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





[ Post a follow-up to this message ]



    Re: Redirect / ReWrite only for the root  
Rich


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
02-26-06 04:24 PM

Thanks, Robert.  The $ eluded me.

All fixed now.






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 11:46 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register