14 votes

How to Change the www root directory on WampServer

For wamp 2.5 on Windows, use a text editor, e.g. notepad++ to edit c:\wamp\bin\apache\apache2.4.9\conf\httpd.conf Change DocumentRoot "c:/wamp/www" to DocumentRoot "c:/my/new/path" (Note slash ...
  • 241
6 votes

How to Change the www root directory on WampServer

Click on Green Wamp Icon (Taskbar right Notification Icons) > Apache > httpd.conf > Replace all ${INSTALL_DIR}/www with your directory. Take care to use / instead of \ Click on Green Wamp Icon > ...
3 votes
Accepted

Site works ok on HTTP, not on HTTPS

The problem that you have is because you have not abled AllowOverride All within the SSL virtual host which allows the use of .htaccess which I suspect contains the URL rewrite rules and conditions. ...
  • 32.6k
3 votes

In httpd.conf why would you want AddType for phps?

loading that file displays the php source instead With syntax highlighting. The same as if you had called PHP's highlight_file() function on that file. It's just a feature if you need to quickly ...
  • 41.6k
3 votes

How to add the ‘www’ prefix to my domain

From What are the most commonly used and basic Apache htaccess redirects? contributed by bybe: Catch all and redirect non-www to www You should opt to use mod_write for redirecting all requests for ...
2 votes

Disabling If-modified-since / if-none-match on web server for some files

Let me make your question a little simpler.. :) What ? Send 200 response instead of 304 How ? Just add this configuration in your Apache setup. <filesMatch "\.(xml)$"> FileETag None <...
  • 131
2 votes
Accepted

Require valid ServerName in httpd.conf

The first virtual host directive is the default "catch all." Any unrecognized host names get handled by whichever virtual host directive comes first. The solution to your problem is to create a ...
2 votes
Accepted

setting rewrite rules in httpd.config file at host server

Just to clarify usage... you can only have one ServerName directive. If you have more than one then the later directive simply overrides the earlier one. However, you can have many ServerAlias ...
  • 41.6k
2 votes

HOWTO log only slow requests in apache httpd

The CustomLog directive allows you to set a condition (in an optional 3rd argument) that is used to control when the request is logged. (On Apache 2.4+ this can take the form of an Apache Expression.) ...
  • 41.6k
2 votes
Accepted

What does "Require all granted" on Directory / (root) REALY means? (Apache 2.4 on CentOS7

This is an issue I've ran into a few times & it stems from a change in terminology from Apache 2.2 to Apache 2.4 (detailed here). Access control options that were previously addressed with 'Order ...
2 votes

Apache httpd.conf && .htaccess directives written in PCRE?

it looks quite similar to PCRE syntax Yes, many of the parameters to Apache directives do take regular expressions (regex) and the "flavour" of regex used is indeed PCRE. This applies to mod_rewrite ...
  • 41.6k
2 votes
Accepted

Why does RewriteRule for "^//(.*)" (begins with double slash) not redirect to a single slash?

RewriteRule "^//(.*)" "/$1" [R=301,L] This will never match because the URL-path that the RewriteRule pattern matches against has already had all instances of multiple slashes ...
  • 41.6k
2 votes

AH00558: httpd: Could not reliably determine server's fully qualified servername error after creating VirtualHost

The problem is with the line ServerName localhost.localdomain in adorkable.conf. The entire server is running on localhost.localdomain. You should use your actual domain name in your VirtualHost ...
1 vote
Accepted

update virtual host's SSL cert after cpanel has expired

If someone has a better answer, please post it. But here's how I was able to achieve it: Goto /var/cpanel/ssl/apache_tls/ You will see a directory for each of your virtual host. Inside each directory,...
1 vote

How to open port 8080 on windows 10, configure firewall and any other settings?

Turns out for some reason my cable modem blocks 8080. I am assuming it must be reserved for another service higher in the list. I had to figure this out on my own as comcast still says it is not ...
1 vote

Put WAMP online but hide its server index page

the server's index file which shows the list of all the projects is also accessible. What I want is to be only able to view it from local machine, not from others. Others can only access the index ...
  • 41.6k
1 vote
Accepted

Why does switching php versions from 56 to 71 in httpd.conf give me a 403 access denied error? (MacOS localhost)

Php7.1 requires the following addition to httpd.conf SetHandler application/x-httpd-php When reverting back to php5.6, that line must be commented out, or again, the php code will not be interpreted....
  • 131
1 vote
Accepted

How can I modify httpd.conf to add one more site in Apache 2.4.6?

My problem is I have already one site in '/var/www/html' with domain1.com. If I add one more site domain2.com create a new folde like /var/www/new or /var/www/html/new, how to modify <VirtualHost *:...
  • 41.6k
1 vote

Can html go in the ErrorDocument value internally in httpd.conf?

Can html go in the ErrorDocument value internally in httpd.conf? Yes. HTML is just text and Apache appears to send this with a Content-Type: text/html header by default anyway. So, when this "text" ...
  • 41.6k
1 vote
Accepted

Fastest Redirection on Apache Server with Wordpress for a Small ~200 Page Website

For 20 links, you are not going to notice a speed difference with any of those methods. None of them are going to add significant overhead. There is significant overhead added by PHP and ...
1 vote
Accepted

Lowercase 301 Redirects - Site Assets Disappear

I think the error is where you have placed these directives in your .htaccess file: RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-l # New ...
  • 41.6k
1 vote

How can I disable the certificate/SSL handshake on the 'www' version of my site served by Apache?

You could do this in your .htaccess file: RewriteEngine on # if https and starts with www, go to http version RewriteCond %{SERVER_PORT} ^80$ RewriteCond %{HTTP_HOST} ^www [NC] RewriteRule ^(.*)$ ...
  • 6,736
1 vote

Apache 2.4 <Directory> with regexp - is the alternation operator broken, or am I confused?

That question made me mix quite some things. This one works as expected according to what I tested, with | operator, taking advantage of the possibility in Apache 2.4 to use the $ sign as line ending: ...
  • 186
1 vote
Accepted

Set DNS subdomain manually

I solved my problem, here is the solution. I have two: First: Updating DNS manager by Zpanel, editing the main domain and in CNAME tab just add the new subdomain manually. It's normal doesn't show ...
1 vote

How to Change the www root directory on WampServer

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
1 vote

RewriteBase has to change when using UserDir

The RewriteBase directive controls the path prefix (the base URL) that is added back when you have a relative path substitution in the RewriteRule. The following (index.php) is a relative path ...
  • 41.6k
1 vote

How to hide awstats url parameters

Try something like the following in the document root's .htaccess file: RewriteEngine On RewriteRule ^stats/$ /awstats/awstats.pl?config=awstatsconffile.org [L] This will internally rewrite requests ...
  • 41.6k

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