Apache :: Redirect To Domain Root When Not Logged In
Sep 12, 2013
I would like to do do following using basic authentication:
1. non authenticated users have access to the index page: [URL] .....
2. there are other pages, e.g: [URL] .... but these would require basic auth
3. if users are not authenticated they would be redirected to [URL] .... otherwise authenticated users would have access to [URL] .... or anything else under that domain
Our web developer is logging in as root through SSH but log files do not show a record. We are getting the normal email notification but last & last -a does not show that they have logged in. Anyone seen this before?
For some odd reason, when I run: chmod 4755 /usr/bin/crontab
in ssh, it still does not change it to 4755. It's like I don't have permission to change it, ans I'm logged in as root.
I've read some threads here on the forum and none really come to an issue where when they run that chmod 4755 /usr/bin/crontab it still doesn't chmod it.
So is there a way to check if it is chmodded to 4755 as I use CSF Exploerer to check if it is chmod'd to 4755, and it just stays at 755.
creating a basic redirect. What I need is to redirect the root of my server 173.x.x.x to a file called test.php in the root of my folder.example: when I go to http://173.x.x.x I get redirected to http://173.x.x.x/test.php..
I have 408 error and put a domain to impersonate the original is blank or rediccionamiento domain to the original. He always says: Time Up and error 408.
I would expect the second - to be replaced by the logged in user. The doc says, the user is logged if the document is protected. I do protect the whole directory using directory match. Without log in I fail to retrieve the document in question.
I moved my content from www,mysite,com to subdomain,mysite,com. I'd like to direct people who come to my site from search engines to the new location of the content.
For example, if they searched for pink purse and the search result was www,mysite,com/pink_purse,html, when they click that link, I'd like for them to redirected to subdomain,mysite,com/pink_purse.html. Can this be accomplished with some .htaccess magic?
is it possible to register a domain name and just use it to re-direct to another domain without paying for hosting etc? for example if i want a standard url to point to a free [url] blog? how would i go about doing this?
The thing is that we have a dedicated server at our company hosting several domains, and right now you can access them both with the www prefix or without it, but there is no redirection in case you access without it, and this has negative impact with SEO related stuff.
I have the rewrite apache module enabled (I tested with a script I found on the net), and I also tried a test configuring a single domain including some code about redirection.
Right now I'm getting a nice "500 Internal Server Error"
This is the code in .htaccess
Code: Option +FollowSymlinks RewriteEngine On RewriteCond %{http_host} ^mydomain.com [NC] RewriteRule ^(.*)$ [url] (mydomain.com is, obviously, a replacement for the real domain in both cases)
I have a server that I have a few domains on, and I have a question about the root domain. I initially picked any old domain, so now all of my name servers are pointing to this one random domain. I have since purchased a few more premium domains, and am wondering if I should change the nameservers to be the more premium domains? Does this matter? Should I have my "main site" be the root domain? Just trying to understand what the implications could be for me.
I'v been searching the internet for ways to redirect/mask a domain in Linux (Ubuntu) and everything points me to godaddy. The server is ssh there is no control panel on it. So if anyone knows a way I can redirect my domain name and mask it that would be great. For example domain1 points to domain2, but in the address bar it shows domain1.
I always use Apache and it's easy to redidrect an entire domain in the htaccess.
Code: RewriteCond %{HTTP_HOST} ^www.domain1.com$ RewriteRule ^(.*)$ [url]$1 [R=301,L] For a site I'm working on I need to achieve the same thing with IIS but have no idea how to and the technician claims it can't be done. Surely, that's not the case. Any ideas?
By the way I want the exact same effect as the above not just a generic redirect that sends everthing to the home page of the new domain.
I just bought a SSL certificate for my domain, let say my domain is domain.com, how do i redirect domain.com to [url]when people type domain.com on their browser? or if someone type www.domain.com then it will redirect to [url]
I have usermin control panel running at https port 10000, but hosted customers have trouble rememembering the port address, hence i want to provide simplified url to all hosted customer so that whenever a customer types [url]or [url]he is forwarded to [url].
I have a number of domains hosted and need a global mod_rewrite rule or whatever that can be specified once in my apache httpd.conf file and it should work for all hosted domains on my server.
I am just wondering whether my idea will work for the google search engine.
Basically, I have my official VPS root (home/admin/public_html/) and this is where my main website will be hosted. However, since my VPS will be used for additional website, I will direct additional domains to it.
My second site hosted on this VPS may have a document root of (home/admin/public_html/advertising/). And my domain will then be setup to have that as its document root.
However, when google searches for my second site (e.g. advertising.com) will it go 'below' the domain root? For example, will it also creep the files under /public_html/ for this domain, even though the domains root is /public_html/advertising/?
edit: Or do people host multiple sites differently? Is this an appropriate method?
Is it possible to redirect parked domains in cPanel to a different URL? I want to redirect each domain to a different url. Can this be done via cPanel or .htaccess?
Is there a way that I could redirect total urls? By that I mean when someone goes to www.domain.com/whatever/file.php?id=345 they get redirected to www.anotherdomain.com/whatever/file.php?id=345
I am a bit confused about domain and sub-domain setup for my website.
I have Wordpress and VBulletin Forum on my website like this:
/www/mywebsite/wordpress /www/mywebsite/vbulletin
Right now, my domain points to this folder: [url]
I have a .htaccess file there which redirects it to the wordpress folder i.e. Redirect permanent /index.php http://www.mywebsite.com/wordpress DirectoryIndex index.php
But, I would like my domain name point directly to the wordpress folder like this: [url]
But the problem when i do that is my "VBulletin" forum get's messed up because then: [url]----------resolves to---------> [url]
I m thinking to resolve this issues, I will have to add a subdomain for forums like this: [url]-> [url]
But I am wondering if I do that, won't it fail again, because it will do this: [url]-----will resolve to-----> [url]
I need a company to register my domain, and then forward emails and urls to my actual site that is somewhere else. I don't need any actual web hosting or email pop (at the moment). My main requirement is reliability.
The company I currently use bounces some email to me and forwards other email to a black hole. They're also not replying to my mail, so it's time to leave. BTW, this is a company that has generally excellent reviews.
I have what seems to be a simple redirect question. I have a dedicated server and a few static IP addresses, but I want to make it so if someone were to type in my IP address in their browser, Apache will redirect them to the domain name. (Typing in [url]
What happens now is that if you were to type in my server's IP address, it will show you the FIRST VirtualHost container that's listed in httpd.conf. This is not so bad since I've placed my main company site at the start of the list, but I'd rather redirect the IP into the domain name I use.
I read somewhere that you can place Mod RewriteRules directly in the VirtualHost container rather than using .htaccess, but the few "rules" that I tried didn't seem to do anything. And yes, I restarted Apache each time I edited httpd.conf.
Is there an easy way to do this?
ALSO, is there a way to redirect the name server address too? If you type in [url]into the browser, it acts the same way. I would ultimately like to redirect both the nameservers and the IP address(es) to the domain name.
I've got two domains (for sake of example, domain A and domain B). Domain A resolves correctly to my web server. Domain B is just sitting collecting dust. I didn't set these domains up, a previous programmer at my job did.
How do I configure resolv.conf, named.conf and the zone file(s) correctly to have domain B redirect to domain A?
I've already set up httpd.conf so that any requests for the host name of domain A will redirect.
e.g. [url]-> [url] I just need the DNS part of this fixed (that I'm a bit of a noob at).
Do I have to do something like this in named.conf:
Code: zone "domaina.com" { type master; file "/var/named/domaina.com.hosts"; };
zone "domainb.com" { type master; file "/var/named/domaina.com.hosts"; }; Then in the domaina.com.hosts zone file add an alias like this?
Code: domainb.com. IN CNAME domaina.com. Or do I need to create a domainb.com.hosts zone file with basic info emulating domaina.com.hosts zone file, and add its entry in named.conf?
I've got two domains (for sake of example, domain A and domain B). Domain A resolves correctly to my web server. Domain B is just sitting collecting dust. I didn't set these domains up, a previous programmer at my job did.
How do I configure resolv.conf, named.conf and the zone file(s) correctly to have domain B redirect to domain A?
I've already set up httpd.conf so that any requests for the host name of domain A will redirect.
e.g. [url] I just need the DNS part of this fixed (that I'm a bit of a noob at).
Do I have to do something like this in named.conf:
Code: zone "domaina.com" { type master; file "/var/named/domaina.com.hosts"; };
zone "domainb.com" { type master; file "/var/named/domaina.com.hosts"; }; Then in the domaina.com.hosts zone file add an alias like this?
Code: domainb.com. IN CNAME domaina.com.
Or do I need to create a domainb.com.hosts zone file with basic info emulating domaina.com.hosts zone file, and add its entry in named.conf?
I've done some manual change of document root in httpd.conf for a user. I know that now, I don't need to to manual change since user can set there own folder!
Now, If I rebuild Apache, he will re-do all the configuration to the original one. Where can I find the settings for domain document root so I can change it and EasyApache will rebuild the httpd.conf correctly?
I don't want to remove the domain since I'll lost all email account!