httpd.conf

Can apache rewrite rules go in httpd.conf

走远了吗. 提交于 2019-12-21 12:14:25
问题 How do I create a simple apache rewrite rule to rewrite: http://domain.com/vanity to http://domain.com/foo/ Also can rewrite rules go in httpd.conf or do they have to go in a .htaccess file? Thanks in advance. 回答1: Put this in your website's <virtualhost> . RewriteEngine On RewriteRule ^/vanity$ /foo/ [L] The [L] will silently redirect, so the user will still see /vanity in the URL. You could use [R] to force a redirect. 回答2: They go in httpd.conf . Check out the doc 回答3: For httpd.conf, wrap

Can't configure the rewrite log

允我心安 提交于 2019-12-21 03:23:13
问题 I'd like to enable the rewrite log to debug some rewrite rules that are giving me problems. So I added these lines at the end of my httpd.conf file: <IfModule mod_rewrite.c> RewriteLog "/logs/rewrite.log" RewriteLogLevel 4 </IfModule> Next thing I did was restart Apache. It causes an error however, and won't start. This is what I get in the XAMPP Control Panel: 13:14:56 [Apache] Error: Apache shutdown unexpectedly. 13:14:56 [Apache] This may be due to a blocked port, missing dependencies, 13

How to enable directory listing in apache web server [closed]

丶灬走出姿态 提交于 2019-12-20 10:25:51
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed last year . I am not able to enable directory listing in my apache web server. I have tried various solutions posted but not working. I just freshly installed httpd 2.4.6 and enabled https using ssl.conf under /etc/httpd/conf.d/ssl.conf dir and trying to access https://server.example.com/ but this is not listing the dir.

Apache Proxy: No protocol handler was valid

ぐ巨炮叔叔 提交于 2019-12-20 08:18:28
问题 I am trying to proxy a subdirectory to another server. My httpd.conf: RewriteEngine On ProxyPreserveHost On RewriteRule .*subdir/ https://anotherserver/subdir/ [P] The problem is that Apache is always logging this: AH01144: No protocol handler was valid for the URL /subdir/. If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule., referer: http://localhost/ So after searching the internet, I have activated these modules:

Apache Proxy: No protocol handler was valid

点点圈 提交于 2019-12-20 08:18:11
问题 I am trying to proxy a subdirectory to another server. My httpd.conf: RewriteEngine On ProxyPreserveHost On RewriteRule .*subdir/ https://anotherserver/subdir/ [P] The problem is that Apache is always logging this: AH01144: No protocol handler was valid for the URL /subdir/. If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule., referer: http://localhost/ So after searching the internet, I have activated these modules:

Move to https://www, when it is www or http:// or without www and http://?

落爺英雄遲暮 提交于 2019-12-20 07:48:55
问题 I am using Zend framework where i have nice looking url controllers. Following .htaccess is working but its making SEO to see us as four links for one page. RewriteEngine On RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^.*$ - [NC,L] RewriteRule ^.*$ index.php [NC,L] RewriteCond %{HTTPS} !=on RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R] I need to do following fix using htaccess: www.stackoverflow.com

URL rewrite in Apache for POST/DELETE/PUT

天涯浪子 提交于 2019-12-20 05:47:09
问题 I have my url like this http://10.243.123.1/v1/data/register I want to redirect/rewrite this url to https://10.243.123.1/data/register (This is HTTP POST/PUT/DELETE url) i.e 1.should remove v1 and make https 2.If url does not contains v1 then just make https alone. What rule should in need to add in httpd.conf file..?? Whether rule goes to httpd.conf or .htacccess file? Please share your thoughts 回答1: Put this code in your DOCUMENT_ROOT/.htaccess file: RewriteEngine On RewriteCond %{REQUEST

How to run a python script in localhost using XAMPP in MAC OS

…衆ロ難τιáo~ 提交于 2019-12-20 04:28:16
问题 I'm trying to run a simple Python script using XAMPP in my MAC. I have followed this link. Anyway I'll tell what I've done in steps. I'm running MAC OS X 10.9.5 and I have python 2.7.5 and python 3.4.1 both installed in this machine. Also I have successfully installed XAMPP 1.8.3-5 in this machine and tested with PHP and HTML pages. Next thing I did was creating a directory named cgi-bin in the path /Volumes/Macintosh\ HD/Applications/XAMPP/xamppfiles/htdocs/ . Inside that directory I've

How do I enable mod_deflate for PHP files?

孤者浪人 提交于 2019-12-20 03:07:40
问题 I have a Liquid Web VPS account, I've made sure that mod_deflate is installed and running/active. I used to gzip my css and js files via PHP, as well as my PHP files themselves... However, I'm now trying to do this via mod_deflate, and it seems to work fine for all files except for PHP files. (Txt files work fine, css, js, static HTML files, just nothing that is generated via a PHP file.) How do I fix this? (I used the "Compress all content" option under "Optimize Website" in cPanel, which

Redirect all but one file in a directory via httpd.conf / htaccess

夙愿已清 提交于 2019-12-20 01:34:34
问题 I would like to redirect as such... http://old.com/a/b/ -> http://new.com/y/z/ http://old.com/a/b/file.php -> http://new.com/y/z/ http://old.com/a/b/c/file.php -> http://new.com/y/z/ http://old.com/a/b/anything -> http://new.com/y/z/ http://old.com/a/b/EXCLUDE.php -> http://old.com/a/b/EXCLUDE.php I currently have the following in httpd.conf and it redirects correctly: RedirectMatch 301 /a/b/(.*) http://new.com/y/z/ I don't know how to exclude one file from being redirected. Basically I want