httpd.conf

redirecting url from one subfolder to another using conf file / ubuntu

坚强是说给别人听的谎言 提交于 2019-12-13 06:22:44
问题 I have web site on domain.com which is located at /var/www/main I also have started another web site which I want to be on url domain.com/a/b But the actual file location is /var/www/main/a/b/c Problem is that I want the users to use url domain.com/a/b and get files from /var/www/main/a/b/c So I've found domains conf file at /etc/apache2/sites-available/domain.com.conf It had only this <virtualhost *:80> ServerName domain.com DocumentRoot /var/www/main </virtualhost> Now after reading

How to run test perl script as cgi script with httpd?

。_饼干妹妹 提交于 2019-12-13 04:16:10
问题 I'm trying to follow this tutorial and run sample script under cgi. Below are steps which I did: 1) Made sample script $ cat > test.pl <<EOF > #!/usr/bin/perl > print "Content-type: text/html\n\n"; > print "Hello, World."; EOF 2) run httpd docker container and mounted created script as volume in cgi-bin directory: $ docker run --name cgi_test --rm -p 3000:80 -v $(pwd)/test.pl:/usr/local/apache2/cgi-bin/test.pl httpd 3) check if CGI module is enabled: $ docker exec -it cgi_test cat /usr/local

mod_rewrite don't match on RewriteCond target - URL not found

别等时光非礼了梦想. 提交于 2019-12-13 03:38:21
问题 I am trying to rewrite all URIs inside directory /docs to /docs/index.php, using apaches mod_rewrite module. The URI doesn't exist as a directory structure, which I don't think is necessary when you are rewriting the URI to something that exit. I am getting the error: "The requested URL /docs/view/my_doc was not found on this server." These are my rewrite rules: RewriteEngine On RewriteCond %{REQUEST_URI} ^docs/([a-z]+)/([A-Za-z0-9_-]+)/?$ RewriteRule ^(.*)$ http://%{HTTP_HOST}/docs/index.php

Apache - how to make http requests into https only? [duplicate]

二次信任 提交于 2019-12-13 01:24:25
问题 This question already has answers here : http to https through .htaccess (15 answers) Closed 3 years ago . How to tell if http://ttt.com or http://www.ttt.com is used by the user, redirect it to https://www.ttt.com ? httpd.conf: <VirtualHost *:80> ServerName www.ttt.com ServerAlias ttt.com DocumentRoot /home/www/html/ttt/public <Directory /home/www/html/ttt/public> #Options ExecCGI #AddDefaultCharset utf-8 DirectoryIndex index.php AllowOverride All Order allow,deny Allow from all </Directory>

How to redirect one domain to another

两盒软妹~` 提交于 2019-12-12 20:19:04
问题 I have two domains: www.example1.com/ --> IP=1.2.3.4 www.example2.com/ --> IP=1.2.3.4 (same IP for both domains) I want all requests that go to www.example2.com/* to access the requested page. I want all requests that go to www.example1.com/* to redirect to www.example2.com/* . How would I do this in apache? As now I am currently doing this in javascript. 回答1: put this code in your DOCUMENT_ROOT/.htaccess file: RewriteEngine On RewriteCond %{HTTP_HOST} ^(www\.)?example1\.com [NC] RewriteRule

HTTP 413 Request Entity too Large

回眸只為那壹抹淺笑 提交于 2019-12-12 18:12:18
问题 I am currently unable to post very large files using the Drupal FileField Source (remote url option) on a custom file field in drupal 7 (7.15). The file is uploading to the tmp directory successfully but failing when it attempts to post. The file size is 870Mb (A 510mb file has posted successfully.). I receive the following error in access_log : 83.000.15.200 - - [02/Oct/2012:12:30:14 +0000] "POST /file/ajax/field_video_source/und/0/form-i6gTPc5LlZsQxKpgO43eaLGjh7dgWqHjQ6TPZD9SRmY HTTP/1.1"

http to www while preserving subfolder?

流过昼夜 提交于 2019-12-12 18:10:55
问题 I have the following rule in .htaccess to redirect from domain.tld to www.domain.tld and it's working fine. RewriteEngine On RewriteCond %{HTTP_HOST} !^www\. RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] However, when trying to access domain.tld/forum , I get redirected to www.domain.tld How can I redirect all non-www to www while preserving whatever subfolder the visitor is in? 回答1: Use REQUEST_URI variable: RewriteEngine On RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteRule ^ http:

Bypass htpasswd authentication for url with index.php and without it

最后都变了- 提交于 2019-12-12 16:02:26
问题 I have added htpasswd protection using htaccess file for authentication, now I want to bypass authenitcation for www.website.com and www.website.com/index.php where both urls are accessing index.php file. By using below htaccess file I have allowed index.php and I'm able to bypass www.website.com/index.php url but not www.website.com My htaccess file is: # set an environtment variable "noauth" if the request starts with "/callbacks/" SetEnvIf Request_URI ^/index.php noauth=1 AuthType Basic

405 error without Access-Control-Allow-Origin in response from Google reCAPTCHA

隐身守侯 提交于 2019-12-12 07:28:52
问题 I am trying to implement reCaptcha by google, but the validation is failing when i call the api mentioned below. In reCaptcha/admin i have mentioned localhost in the Domains list. google.com/recaptcha/api/siteverify Below is the error that i have been getting. XMLHttpRequest cannot load https://www.google.com/recaptcha/api/siteverify. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http:/

httpd AND Tomcat with mod_jk on Port 80 test fails

人走茶凉 提交于 2019-12-12 04:44:13
问题 I need locally on windows 7 machine to start tomcat's example applications on port 80 like this: http://localhost:80/examples/ . I m following this great and simple tutorial and it works great when trying any of the tutorial's results: http://localhost:7000/examples/servlets ,Try Tomcat's servlet examples via Apache http://localhost:7000/examples/jsp ,Try Tomcat's JSP examples via Apache http://localhost:7000/examples ,Try Tomcat's examples via Apache http://localhost:8181/ws ,Access ws from