New answers tagged

1

Ok, I had to add ServerAlias for each server, didn't think of it because before I had a mod_rewrite rule to remove the www. prefix... <VirtualHost 127.0.0.1:8080> DocumentRoot /var/www/html/afarber.de ServerName afarber.de ServerAlias *.afarber.de ErrorLog logs/afarber.de/error_log CustomLog logs/afarber.de/access_log common </...


1

My current solution is to use the RedirectPermanent directive The RedirectPermanent (mod_alias) directive is prefix matching so, as you have found, you will be redirected to the "corresponding path" on the newdomain. However, the complementary mod_alias directive RedirectMatch matches using a regex and will allow you to redirect all URLs to the single ...


2

I think this should do the trick for you. On the old domain, put this code in the .htaccess file (this assumes a 301 redirect is used). RewriteEngine On RewriteRule (.*) https://newdomain.example [R=301,L]


1

Set DocumentRoot value to "/var/www" which is the path your PHP script is in. If you have a virtual host entry matching either localhost or the IP address of localhost on your machine then set DocumentRoot value in that virtual host block to "/var/www". Then restart apache. See details for DocumentRoot here: https://httpd.apache.org/docs/2.4/mod/core....


1

If you discount that a person has some inside knowledge, the answer is no. How can anyone know about something that they can't see or know about? But what is the point of having these folders if you aren't using some of the content? Assuming you do use the content, unless you are doing some really fancy coding, then you have to link to the content and ...


0

Both; Yes. And No. For the No part. Apache is not expecting a variable within a configuration file. It is just not coded for that. As well, from a logic perspective, it would be impractical for Apache to fill in variables in various configuration files without yet another layer of configuration. Apache is intentionally lightweight for a reason. Any service ...


2

Take a look at mod_macro, sounds like it may be exactly what you need for your use case.


1

So, my question is: Is there a performance reason to nail virtual hosts to fixed IP specifications? The only performance related reasons for using name based vs ip based is if you've got a limited pool. Name based virtual hosting will not occupy precious IP addresses. The server will be parsing/processing the http headers whether or not you use name ...


1

I finally found out that I was missing a trailing / on the ProxyPass commands. Previously I had written: ProxyPass / http://cloud.myDomain.com ProxyPassReverse / http://cloud.myDomain.com It should be: ProxyPass / http://cloud.myDomain.com/ ProxyPassReverse / http://cloud.myDomain.com/


4

Your attempting to access the site using a IP address when your virtual host file is setup to use a domain name, not an IP address... so it'll throw up the default folder, in this case /var/www/html/. Fix 1. Local Virtual host file The most common and easy method to fix the issue would be to edit your host file within Windows or Mac, this will allow you to ...



Top 50 recent answers are included