Forum Moderators: phranque
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.
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.
wifi,
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.
Jim