Welcome to WebmasterWorld Guest from

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Redirect all urls to my default page

redirect www.google.com to my web-page



4:04 am on May 20, 2004 (gmt 0)

Inactive Member
Account Expired


i am building a web server-client system. my web-server also has an authentication system where the registered users use a login page to authenticate themseleves.once they do,the proxy.pac gives them the proxy.
right now i am looking at a scenario where an unauthenticated user tries to log onto say www.google.com or www.webmasterworld.com ...he should be redirected to a default login page( is my websever url).
could somebody tell me how it can be done?
3:18 pm on May 20, 2004 (gmt 0)

Junior Member

10+ Year Member

joined:Aug 9, 2003
votes: 0

This is the same question I have open. I can get everything from the one site, but I have fooled around with the mod rewrite for 2 days.

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www\.)?domain\.com
RewriteRule ^(.*)$ [mydomain.com...] [R]

This is what I currently have in the .htaccess, but with it I can't open any pages.

4:23 pm on May 20, 2004 (gmt 0)

Senior Member

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 31, 2002
votes: 0


If you will describe your project in more detail, you may get some help. I read your description, but I can't really tell what you are trying to do -- what function resides on what server, and how it is implemented. As such, I can't tell if the solution will be inside Apache or require a custom-scripted solution, or a mixture of both. Perhaps you could invoke mod_proxy if the user is not authenticated, and "map" all external URLs to a single internal "Please log in" page.


As written, your code will redirect "mydomain.com" to "mydomain.com" using an external redirect. This results in an "infinite loop", so a page is never served (check your server error log for the message "Redirection limit exceeded..."). If you will post your code and a more detailed description of your goal in your original thread, you will probably get better advice.