apache2

How do I redirect 404's to index.html and rewrite the URL to the home page URL?

扶醉桌前 提交于 2019-12-17 19:33:38
问题 I changed a bulky, complex website into a small one-page website, so users need to be redirected from 404s to index.html. I put this in .htaccess : ErrorDocument 404 /index.html If you type mydomain.com/lalalalala , this redirects to the home page content ( mydomain.com/index.html ), but the URL bar still says mydomain.com/lalalalala . How do I redirect 404s to index.html and rewrite the URL to mydomain.com ? EDIT: I'm using Bluehost. 回答1: You can use these 2 lines at the top of your

How to install & configure mod_wsgi for py3

妖精的绣舞 提交于 2019-12-17 18:07:31
问题 I installed & configured mod_wsgi for python2.7 but now I would also like to have mod_wsgi for py3 I'm in ubuntu 12.04 My apache conf file looks like this for py2.7 : <Directory /var/www/vhosts/my_web> WSGIProcessGroup my_web WSGIApplicationGroup %{GLOBAL} Order deny,allow Allow from all </Directory> Now I would like to install mod_wsgi for python3. I think I have to do apt-get install libapache2-mod-wsgi-py3 But I can't find any instruction on how to configure mod_wsgi for py3. a) Can I keep

mod_rewrite - how to rewrite an URL?

孤街醉人 提交于 2019-12-17 16:56:11
问题 Is there a way to rewrite an URL like http://mydomain.com/getProduct.php?id=1&mode=simple in http://mydomain.com/products/1/simple using mod_rewrite in Apache2? 回答1: RewriteRule /products/([0-9]+)/([a-z]+) /getProduct.php?id=$1&mode=$2 For more information search google for mod_rewrite tutorials. 回答2: You may find this article helpful: URL Rewriting for beginners. Also search for Mod Rewrite Cheat Sheet in Scribed, I found it helpful before. [ Sorry couldn't post the link as I am allowed to

mod_rewrite - how to rewrite an URL?

自闭症网瘾萝莉.ら 提交于 2019-12-17 16:56:09
问题 Is there a way to rewrite an URL like http://mydomain.com/getProduct.php?id=1&mode=simple in http://mydomain.com/products/1/simple using mod_rewrite in Apache2? 回答1: RewriteRule /products/([0-9]+)/([a-z]+) /getProduct.php?id=$1&mode=$2 For more information search google for mod_rewrite tutorials. 回答2: You may find this article helpful: URL Rewriting for beginners. Also search for Mod Rewrite Cheat Sheet in Scribed, I found it helpful before. [ Sorry couldn't post the link as I am allowed to

How Can I Have A Conditional .htaccess Block?

老子叫甜甜 提交于 2019-12-17 15:44:46
问题 This is an Apache question you've probably come across before. I want to have one source package that I can deploy to my workstation, my staging server, and my production server, but for it to load different .htaccess settings based on what the URL was. Note that I was using a kludge with an IfModule call, but that won't work with our new production server because it shares all the same modules as my staging server. Note I need to bundle SetEnv with these rewrites. Currently if you use

Windows 7 php + Symfony2 terribly slow

狂风中的少年 提交于 2019-12-17 15:24:42
问题 This is an issue I've been having for a long time. I want to run PHP applications on my windows computer and it has a terribly high load time, around 10-25 seconds. I have tried many things: First I tried a simple XAMPP installation I read WAMP might be faster, so I tried WAMP, too. It gave me the same results Then I installed an nginx server with PHP, but it did not help either Finally, I installed an Ubuntu 11.10 in VirtualBox and I shared my windows files containing my project, but the

Apache won't follow symlinks (403 Forbidden)

ε祈祈猫儿з 提交于 2019-12-17 15:12:42
问题 I'm having some trouble setting up Apache on Ubuntu. I've been following this guide. # /usr/sbin/apache2 -v Server version: Apache/2.2.17 (Ubuntu) Server built: Feb 22 2011 18:33:02 My public directory, /var/www, can successfully serve up and execute PHP pages that are placed in it. However, I want to create a symlink in /var/www that points to a directory in my home folder and serve pages there. [root /var/www]# ll total 36 drwxr-xr-x 3 root root 4096 2011-09-11 14:22 . drwxr-xr-x 14 root

URL rewriting for different protocols in .htaccess

早过忘川 提交于 2019-12-17 11:54:43
问题 I need help with url-rewriting in .htaccess. So the issue is about different protocols: https and http. The main purpose of rewriting is to remove "www" from URL, but protocol should stay the same it was before. For example, when I have URL like http ://www.domain.com/request, it should be redirected to the http ://domain.com/request. I resolve it with these rules: RewriteBase / RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC] RewriteRule ^(.*)$ http://%1/$1 [R=301,L] But in case, when URL looks

Setting up Git Server on Windows With git-http-backend.exe

冷暖自知 提交于 2019-12-17 08:31:08
问题 I am in the process of setting up a Git server (1.7.2.3) on a WS 2008 machine using Apache and git-http-backend.exe. I have been following a good tut here. I have the GUI working, I can annoymously clone and if I put the following in the config of a repo I can annoymously push: [http] receivepack = true I have added the following to the httpd.conf file: SetEnv GIT_PROJECT_ROOT C:/GIT/Repositories SetEnv GIT_HTTP_EXPORT_ALL ScriptAliasMatch \ "(?x)^/(.*/(HEAD | \ info/refs | \ objects/(info/[^

How do I ignore the Perl shebang on Windows with Apache 2?

梦想的初衷 提交于 2019-12-17 06:46:55
问题 I have set up a local Perl web environment on my Windows machine. The application I'm working on is originally from a Linux server, and so the shebang for source .pl files look like so: #!/usr/bin/perl This causes the following error on my Windows dev machine: (OS 2)The system cannot find the file specified. Is it possible to change my Apache 2 conf so that the shebang is ignored on my Windows machine? Of course I could set the shebang to #!c:\perl\bin\perl.exe , that much is obvious; but the