httpd.conf

Syntax for 301 redirect of www to non-www using httpd.conf

戏子无情 提交于 2019-11-27 07:42:43
问题 How do I setup a rule (on httpd.conf) to redirect all the traffic from www.domain.com to domain.com ? Will the following work? <VirtualHost www.domain.com> Redirect 301 / http://domain.com/ </VirtualHost> Where should I put this tag in httpd.conf ? Does the order matter? 回答1: This is an example of what you can use/do: <VirtualHost *:80> DocumentRoot "/var/www/domain.com" ServerName domain.com ServerAlias domain.com www.domain.com <Directory "/path/to/public_html"> allow from all Options

mod_rewrite or mod_alias?

和自甴很熟 提交于 2019-11-27 01:48:36
问题 I have a server, its httpd.conf already has some " RedirectMatch permanent " directives in it. I'm not that familiar with mod_alias, I've only ever used mod_rewrite. What's the basic difference? I don't see a "L" flag in mod_alias to stop processing rules. Which one should I use for best practices of redirecting from one sub-domain to another? Can I use both at the same time and will it be obvious which takes precedence? 回答1: mod_alias is basically a simpler version of mod_rewrite. It can't

Where can I find the WAMP error log?

六眼飞鱼酱① 提交于 2019-11-26 23:02:31
问题 I am using WAMP2.2 on Windows. I need to set up SSL port on my server. My Apache, WAMP and site work well without SSL. But when I uncomment the line Include conf/extra/httpd-ssl.conf in my httpd.conf , the WAMP Server is not working anymore.(It remains orange when I restart). I assume that something is wrong with the configurations in httpd-ssl.conf . But I am wondering how I can find the error that doesn't let WAMP to start properly. Is there any error log file for WAMP? I found these errors

Configure Apache .conf for Alias [closed]

一笑奈何 提交于 2019-11-26 19:44:37
问题 So I cant get an alias working in "/etc/httpd/conf.d/vhosts.conf" which contains all of my virtual hosts: <VirtualHost *> ServerName example.com Alias /ncn /var/www/html/ncn DocumentRoot /var/www/html/mjp </VirtualHost> I want my alias to work so I can point example.com/ncn to "/var/www/html/ncn". This works if I have it in "/etc/httpd/conf/httpd.conf" but not my "/etc/httpd/conf.d/vhosts.conf" Any ideas why? Everything else seems to work i.e. ServerAlias's Cheers, Peter 回答1: Sorry not sure

WAMP 403 Forbidden message on Windows 7

不想你离开。 提交于 2019-11-26 19:40:51
I have installed WAMP version 2.1 on my windows 7 machine. When i browse to localhost in my browser, the WAMP server page is visible. But when I browse to my IP in my browser, I get the message 403 Forbidden: You don't have permission to access / on this server. Any suggestions? The access to your Apache server is forbidden from addresses other than 127.0.0.1 in httpd.conf (Apache's config file) : <Directory "c:/wamp/www/"> Options Indexes FollowSymLinks AllowOverride all Order Deny,Allow Deny from all Allow from 127.0.0.1 </Directory> The same goes for your PHPMyAdmin access, the config file

Apache is not sending 304 response (if mod_deflate and AddOutputFilterByType is enabled)

喜夏-厌秋 提交于 2019-11-26 18:09:33
问题 I have added the following line in my Apache httpd.conf: - AddOutputFilterByType DEFLATE text/html text/css application/javascript application/x-javascript application/json I have a html file (test.html) with a script inclusion: - <script type="text/javascript" src="/test.js"></script> The problem is, every time I load test.html, test.js is also loaded with HTTP status: 200. The question is: Why conditional GET is not satisfied? If I comment out the "AddOutputFilterByType" line in httpd.conf,

Forbidden You don't have permission to access / on this server [closed]

╄→尐↘猪︶ㄣ 提交于 2019-11-26 17:17:09
All I wanted to do today was to write a redirect rule to a subfolder, e.g.: You enter the URL: example.com and you get redirected to example.com/subfolder Such a simple wish. I tried to find a solution on the internet. The internet told me to add an .htaccess file in the htdocs root with: RewriteEngine on RewriteCond %{HTTP_HOST} ^example\.com$ RewriteRule (.*) http://www.example.com/$1 [R=301,L] RewriteRule ^$ subfolder [L] I did this. But no success obviously, they didn't told me I had to uncomment the module in httpd.conf : LoadModule rewrite_module modules/mod_rewrite.so So I did this too.

.htaccess: RewriteEngine not allowed here

霸气de小男生 提交于 2019-11-26 14:04:11
问题 I uploaded the .htaccess to the server and received an Error 500 (Internal Server Error) . And in the error log I had the following error: .../.htaccess: RewriteEngine not allowed here But mod_rewrite.so is enabled. So, do I need to change <Directory /> Options FollowSymLinks AllowOverride None </Directory> to <Directory /> Options FollowSymLinks AllowOverride All </Directory> in the /etc/httpd/conf/httpd.conf file? Or could it be something else? The .htaccess file should be okay, because it

Lost httpd.conf file located apache [closed]

纵然是瞬间 提交于 2019-11-26 12:34:13
How can I find where my httpd.conf file is located? I am running an Ubuntu Linux server from the Amazon Web Services EC2 (Elastic Compute Cloud) and I can't find my Apache config. squiguy Get the path of running Apache $ ps -ef | grep apache apache 12846 14590 0 Oct20 ? 00:00:00 /usr/sbin/apache2 Append -V argument to the path $ /usr/sbin/apache2 -V | grep SERVER_CONFIG_FILE -D SERVER_CONFIG_FILE="/etc/apache2/apache2.conf" Reference: http://commanigy.com/blog/2011/6/8/finding-apache-configuration-file-httpd-conf-location See http://wiki.apache.org/httpd/DistrosDefaultLayout for discussion of

Forbidden You don&#39;t have permission to access / on this server [closed]

纵饮孤独 提交于 2019-11-26 04:17:27
问题 All I wanted to do today was to write a redirect rule to a subfolder, e.g.: You enter the URL: example.com and you get redirected to example.com/subfolder Such a simple wish. I tried to find a solution on the internet. The internet told me to add an .htaccess file in the htdocs root with: RewriteEngine on RewriteCond %{HTTP_HOST} ^example\\.com$ RewriteRule (.*) http://www.example.com/$1 [R=301,L] RewriteRule ^$ subfolder [L] I did this. But no success obviously, they didn\'t told me I had to