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 </...


2

You have no control over the headers of the Google Analytics javascript file, as it is not served by your server. The .htaccess rules you mentioned can only apply to your own files. You'll just have to ignore that particular error, and hope Google make the file a bit more cache friendly in future.


0

I just added gzip compression via the .htaccess file on Bluehosts's WordPress Hosting. By default, it had the source html/php and CSS files gzipped. Adding this code from BlueHost's WordPress optimization tips article enabled gzip for JS files, images, etc: <ifmodule mod_deflate.c> AddOutputFilterByType DEFLATE image/gif image/png image/jpeg image/x-...


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

I tried doing this, but found that it got overwritten upon wamp restart. You can fix it for good by editing the $wwwDir variable in wamp/scripts/config.inc.php


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 ...


0

I didn't use mod_python yet, but it seems to me that the script is expected to return (rather than print) the text to be served, and to contain an index function to accomplish this. If you don't define the index function, mod_python won't know what to do about your module.


2

Are you talking about allowing upload of content via the webserver or something else? Regardless you should be ensuring that the permissions are already set up so that your PHP code can only write to designated locations (directories) seperate from your website content. This can be difficult on cheap, shared hosting. Content upload Frank's answer is ...


5

It is generally unwise to allow www or apache to have write access, however, this can be done safely by limiting the access to a single directory and not allowing any executables in that directory. For example, the docroot of your php based site is /var/www/example.com You would want your webserver setup so that the only php executable access point is /var/...


2

You could try the following (mod_rewrite directives) in the .htaccess file in the document root: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.+/)?(?:[^/]+)/([^/]+)$ $1$2 [L] If the requested file does not exist (!-f) then internally rewrite the request by removing the parent directory ((?:[^/]+)) from the URL. $1 is a backreference ...



Top 50 recent answers are included