14

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 direction). This will change the location where files are served from (~Line 230). Change <Directory "c:/wamp/www"> to <Directory "c:/my/new/path"> (Note ...


5

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 > Apache > httpd-vhosts.conf > Replace again the existing "www"-Directory with yours Click on Green Wamp Icon > "Restart All Services" (Tested on Windows 10, ...


3

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 document some code. Many sites display syntax highlighted code on their blogs etc. PHP has this built-in if you need it. If you don't need it, remove it. could ...


3

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 non www versions of your site because the $1 varible will catch page names, so example.com/page1/ will automaticly redirect to www.example.com/page1/. ...


3

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. Add this code to your SSL virtual host: # START NEW CODE <Directory /var/www/html/joomla> Options FollowSymLinks MultiViews Options -Indexes ...


2

After doing the above, you can also change the: in the of wamp directory (wampmanager.ini, wampmanager.conf). php.ini my.ini Save your changes and close Wampserver.


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


2

Apache applies configurations for directories to a request from smallest to largest. In essence the <Directory /> section specifies virtual host defaults; since every other possible directory will have that portion in its path. If multiple (non-regular expression) sections match the directory (or one of its parents) containing a document, then ...


2

Not all servers use httpd.conf, but all have some type of configuration file. If you're using apache, the httpd.conf configurations can be overriden through .htaccess file in the root web directory unless overrides are turned off in httpd.conf See: http://httpd.apache.org/docs/2.2/howto/htaccess.html


2

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 directives. In terms of resolving the requested domain name (ie. you request www.example.ma and the server is able to match this) it doesn't really matter whether www....


2

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.) However, this condition is generally based on a property of the request (file type, request header, etc.), rather than something that is associated with the ...


2

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 X, Allow or Deny from X', can now be managed with 'Require X'. The simplest use case example would be... Apache 2.2: Order allow,deny Allow from all ..on the ...


2

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 and in fact any other Apache module that uses regex. There are some minor differences (and additions) in the syntax used by Apache, but this is primarily ...


2

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 <ifModule mod_headers.c> Header unset ETag Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate" Header set Pragma "no-...


2

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 default virtual host directive that prints out an error. I have one that I use. I've previously posted it in this answer 404 Not Found -- Hostname Not ...


2

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 configuration. ServerName example.com If the domain name is not yet pointing to the server you can test by putting it into your /etc/hosts file: 127.0.0.1 ...


2

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 reduced to a single slash. To redirect such requests you can make use of this "feature" and simply redirect "to itself" and check against ...


1

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.


1

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 *:80> part? because I have deified DocumentRoot /var/www/html. I'm not really sure what the "problem" is? You copy the entire <VirtualHost *:80> ...


1

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" hits the browser the browser renders it as HTML, even when sending a simple string of text. ...would apache accept html as text? As stated above, HTML is ...


1

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 directives inserted... RewriteCond %{REQUEST_URI} [A-Z] RewriteRule . ${lc:%{REQUEST_URI}} [R=301,L] RewriteRule .* index.php [L] RewriteRule ^index.php/(.*)$ [...


1

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 ^(.*)$ http://%{SERVER_NAME}%{REQUEST_URI} [L,R=301] # if not https and it doesnt start with www, go to https version RewriteCond %{SERVER_PORT} !^80$ RewriteCond %{...


1

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: <DirectoryMatch "/opt/lampp/htdocs/[^/]*/public/(uploads(/[^/]*)?|(wp/wp-content/uploads(/[^/]*)?))$"> Require all granted </DirectoryMatch> &...


1

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 the subdomain on DNS management, just create a new CNAME entry, save and in SSH write: php /etc/zpanel/panel/bin/daemon.php This command will make your daemon ...


1

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 WordPress to run your site. The redirects are not going to impact performance at all. For a very large quantity of redirects (thousands), individual rewrite rules ...


1

the example you provide should and does work (tested on 2.2). so I guess the problem will be somewhere else. your env may be getting an another value somewhere else? (note the regexp will not match plain 'sorryspammer.com' - you need something like ^(.*\.)?sorryspammer\.com$ note2: you could use .*sorryspammer, but that is bad practice, since it matches ...


1

httpd.conf is available only if you have Apache as the web server. Nginx and LiteSpeed have their own configuration files and names. On cPanel servers it is under the /usr directory, whereas on plain servers with Linux distros, it is under the /etc directory.


1

There is no 'proper' location for any config file on a unix system. It can be anywhere the system admin wants to put it. There are conventions - like putting the base config file in /etc/ - but they are just that: conventions. It may make sense in some web hosting environments to cather all the config files in each user's folder, or one common folder for ...


1

There is no way to change the port numbers for cPanel, the WebHost Manager or Webmail. The port numbers are hard-coded into cPanel and there is no configuration option that allows them to be changed. Even if you edit the httpd.conf file and change the ScriptAlias directives that cause /cpanel, /webmail and /whm to work, they will still be accessible via ...


1

I would strongly recommend for the second one that has special characters that you use the <LocationMatch> Directive. The <LocationMatch> directive limits the scope of the enclosed directives by URL, in an identical manner to <Location>. However, it takes a regular expression as an argument instead of a simple string. (http://httpd....


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