homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

Redirect all urls to my default page
redirect www.google.com to my web-page

10+ Year Member

Msg#: 1564 posted 4:04 am on May 20, 2004 (gmt 0)

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?


wifi on the fly

10+ Year Member

Msg#: 1564 posted 3:18 pm on May 20, 2004 (gmt 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.


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

Msg#: 1564 posted 4:23 pm on May 20, 2004 (gmt 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.


Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved