Tag Info

Hot answers tagged

8

When you type the URL in a web browser, http://www.foo.com, it will always attempt to connect on port 80. It's not so much that the port is being hidden, but rather that it's being assumed, since port 80 is the default for HTTP requests. Along the same line, if you browse to https://www.foo.com, it will always attempt to connect on port 443 unless you ...


6

What will occur depends on how you have setup your web server. A web server may be setup to display an index page - that is a page that is displayed when a directory is accessed. In this case, the server will typically try all the files listed (e.g. index.htm, index.html, index.php, etc) in the order listed, and display the first one that is available, or ...


5

I would have said that placing these sensitive files above the document root would be preferable. And perhaps easier to manage if they are all contained in a particular directory, however... Using .htaccess to prevent access to all .db and .exe files and return a 403 - Forbidden. <Files ~ "\.(db|exe)$"> Deny from all </Files> Unless you have ...


3

If wamp is running make sure no other program conflict Wamp such as IIS, Microsoft Web Deploy, SQL, Skype, Zonealarm, firewall/antivirus, NOD32, Eset, any web related program including Remote Desktop, Teamviewer ... IIS and Apache/Wamp are both web server and might conflict in some way, so you have to disable IIS in order for Wamp to work Disable IIS in ...


3

The s-maxage header is intended for proxies, while max-age is intended for regular users. A typical end user (not using a proxy) would have the file cached for a year. The same should be the case for someone using a proxy as well, since the proxy will likely send the file unmodified, i.e. including the max-age header. But the proxy itself would only cache ...


3

In order to work with two names under one site you have Respond from Apache side on both Host request (you done it) Configure DNS for domain in order to have 2 URLs route to the correct host In short: nslookup foobar.com and nslookup www.foobar.com must return answers and answers to be identical Your impression about <Directory> container ...


3

Your <Dav On directive is not complete (no need for <) -- I assume it's just a copy-paste issue. More importantly -- you are using <Location> directive ... but providing physical path on your file system/hard drive. That's wrong -- <Location> is used to match URLs, not directories; to match directories you need to use <Directory>. ...


3

Apache configuration is exhaustively covered in the Apache documentation (though, if you're using Debian or Ubuntu, there are some additional considerations) and the best way to familiarize with Apache will be to study each portion of the documentation as you encounter a need to use a particular module or set of directives. To address your specific ...


3

FIRST: First defined VirtualHost will be used as catch all for unknown domain names. Apache does not know about apples.co.uk -- it only knows about www.apples.co.uk. So it uses first Virtual Host to serve apples.co.uk. Redirect will work OK here. Apache does not know about bananas.co.uk -- it only knows about www.bananas.co.uk. So it uses first Virtual ...


3

You have to question some confusion, so I'll talk about ways to do a redirect from www to no-www: 1.Create two VirtualHost for two domains and use 301 redirect: NameVirtualHost *:80 <VirtualHost *:80> ServerName example.com DocumentRoot "/path/to/site" </VirtualHost> <VirtualHost *:80> ServerName www.example.com Redirect ...


3

When you type an URL in a browser, unless you specify the port explicitly, the browser will assume port 80 (unless the path is HTTPS, in which case port 443 is assumed). Technically any URL can be rewritten to include :80 port directive. It is just redundant. On the server side there can only be one service listening at port 80. So, no, you can not have ...


2

The HTTP protocol uses port 80 by default. If you configure your web server to use a nonstandard port, then the port needs to be specified in the URL. There's no way to hide that. In Apache, you can set the listening port in httpd.conf, e.g.: Listen 127.0.0.1:80 This can however be overridden in the vhost config, e.g.: <VirtualHost *:80>


2

Just create another virtual host for mail.example.com, and you can tell Apache to do whatever you want when people go to that host. <VirtualHost *:80> ServerAdmin admin@example.com ServerName mail.example.com ErrorLog logs/example_com-error_log # if you care about hits: CustomLog logs/example_com-access_log common Then, if you ...


2

i had simalr problem and suggested answers didn't work for me. then read instructions of installing the application from -wampserver.com.... where it says: warning... you install install Visual C++ 2010 SP1 as shown below..... WARNING : You must install Visual C++ 2010 SP1 Redistributable Package x86 or x64 VC10 SP1 vcredist_x86.exe 32 bits : ...


2

As others have said, it's working now. For the actual reason: Just wait a little while. This error comes up on Dreamhost when you make some kinds of edits–in your case see the "DNS changes" heading for a detailed explanation–and they haven't fully resolved yet. If it lasts more than a couple of hours, then you should file a support request, because ...


2

Sadly it is not possible since this is controlled by the browsers. By default browsers will connect to port 80 and anything else needs to be added in the URL. There is 3 solutions I can think of what could work but ultimately it will not work for public users since some coding on the clients machines would need to be changed. Host File Method You could ...


2

You can use the .htaccess file to redirect from IP to domain using this code: Options +FollowSymLinks RewriteEngine on RewriteCond %{HTTP_HOST} ^555\.555\.555\.555 RewriteRule (.*) http://www.example.com/$1 [R=301,L] Change 555.555.555.555 to match the IP of your server, additionally though you can use canonical urls that will prevent duplicates entering ...


1

Works fine for me too: play.mink7.com Coming Soon! The DreamHost customer who owns play.mink7.com has not yet uploaded their website or has chosen to leave this holding page active. If you are the owner of this domain, you'll find your login information contained within the emails sent to you when your account was activated. Once logged in, you'll be able ...


1

I believe it is because the browser is not sending a If-Modified-Since during the Request, right? Correct. Do I need to change something in the initial Response headers to make 304s happen? Yes. If you compare original response headers for those resources that have 304 response code on subsequent requests, you will notice: All of them located in ...


1

Actually, it is impossible to specify different php.ini files for each virtual host. However you can change almost anything in the php.ini file by using the ini_set() function: It allows you to set the value of a given configuration option. The configuration option will keep this new value during the script's execution, and will be restored at the ...


1

I had that same issue, and don't know why it is failing either. I was able to work around it using this instead: <VirtualHost *:80> ServerName domain.com ServerAlias *.domain.com # Redirect 301 / https://www.domain.com RedirectMatch permanent /(.*) https://www.domain.com/$1 </VirtualHost>


1

Change to this and try it, notice only two VirtualHost <VirtualHost *:80> ServerName domain.com ServerAlias *.domain.com Redirect permanent / https://www.domain.com/ </VirtualHost> <VirtualHost *:443> DocumentRoot /var/www/domain/ ServerName www.domain.com SSLEngine on SSLCertificateFile ssl.crt SSLCertificateKeyFile ...


1

Setup a new default site in your apache-config and rewrite the url via .htaccess if this default site is called. Maybe something like /var/www/invalid-subdomain/.htaccess: RewriteEngine on RewriteBase / RewriteRule ^$ http://example.com/ [R,L] The above example is working well for my apache2 squeeze server.


1

I don't have any experience with Mono, but it seems like the other sites should work if you leave the location as / but only the base site would work if you set the location as /Landing. What most people would do is simply leave the location as / and use mod_rewrite to map non-phpmyadmin or -phpvirtualbox requests to the /Landing/ directory, e.g. ...


1

Ctrl+U to view page source in Firefox Ctrl+F and enter http: to find the resources requested from a non-SSL connection Correct references to unsecured resources (you can use URI's of the form //domain.com/resource to avoid specifying HTTP/SSL)


1

Depending on the webserver you're running and its configuration, yes. It is very common that index.html is read from the folder the webserver points to if you don't add a filename in the URL. In Apache, for example, these filename(s) are defined in the configuration with the directive DirectoryIndex. In Microsoft IIS default.asp is a common default ...


1

But let's say you want people from your LAN to have full access, without being prompted for a password. In this scenario we could use: <Directory /home/www/site1/private> AuthUserFile /home/www/site1-passwd AuthType Basic AuthName MySite Require valid-user Order allow,deny Allow from 172.17.10 Satisfy any </Directory> This will ...


1

Use root-relative paths (/path/to/your.css). These are just as good as absolute paths for most sites, they just allow you to access your assets via multiple hosts. Add an entry for your domain in your hosts file: 127.0.0.1       www.example.com


1

According to this: <Directory> and </Directory> are used to enclose a group of directives that will apply only to the named directory, sub-directories of that directory, and the files within the respective directories. So if you omit the trailing slash then this should work: <Directory /Library/WebServer/.../secrets> secrets/* ...


1

Well, as mentioned by @Book of Zeus, this depends on how affecting are your rules. .htaccess works with a hunting process, this means... suppose you have a file being accessed at /var/www/foo/bar/baz/dir1/dir2/file.ext Apache will first parse and identify if file or directory exists. Then it will check if there is any .htaccess file inside ...



Only top voted, non community-wiki answers of a minimum length are eligible