apache

Configure Apache to route "GET /user/foo" to /user/GET.php and "PUT /user/foo" to /user/PUT.php

I would like to arrange things so that a GET request for e.g. http://example.com/user/[email protected] internally calls the script /var/www/example.com/rest/user/GET.php and a PUT request for the same URL internally calls the script /var/www/example.com/rest/user/PUT.php and so on for the other HTTP verbs POST and DELETE. It's almos...

Apache ReWrite rule to exclude an individual file or type of file?

Can you help me with an Apache rule to exclude a particular file name or type of file? Here are my current rules: RewriteRule ^/(?:blog)/ - [L] RewriteRule ^crossdomain\.xml$ - [L] (Based on first response) RewriteRule ^/(.*_css.*\.css.*) /$1 [QSA,L] RewriteRule ^/(.*_js.*\.js.*) /$1 [QSA,L] RewriteRule ^/(.*_swf.*\.swf.*) /$1 [QSA,L]...

compiled or interpreted / apache mod or FastCGI for this use case?

We have a server-side component that is currently written in PHP on Apache2 that is essentially a cross domain proxy that uses cURL to make external HTTP requests, does header processing and performs some regular expression replacement on the payloads. It is going to be the most heavily used piece of server-side code for our site. PHP i...

Location Bar Doesn't Show Redirected URL

This is my httpd.conf file for my http://old.example.com : RewriteEngine on RewriteBase / RewriteRule ^login$ http://another.example.com/login [L] The problem is that although I can redirect to http://another.example.com/login, but the location bar is still showing http://old.example.com/login. Any idea how to fix this? ...

Multiple RewriteConds and RewriteRule Stacked Together

I have this apache rewrite rule: RewriteEngine on RewriteBase / RewriteCond %{HTTP_HOST} mycompany.com RewriteRule ^$ http://mycompany.com/login [L] # we check if the .html version is here (caching) RewriteRule ^$ index.html [QSA] RewriteRule ^([^.]+)$ $1.html [QSA] RewriteCond %{REQUEST_FILENAME} !-f # no, so ...

Why aren't my ruby processes exiting on my FastCGI shared server when using send_file?

After developing an awesome app on my local machine without any consideration of how it would perform on my host, I have run into a terrible issue. I am serving files (.pdf & .zip) through rails send_file so that I can log statistics. The only problem is that when two (or more) files are downloaded simultaneously, a new ruby dispatch.fcg...

mod_rewrite - need help with friendly URL

How would you mod_rewrite a url to go from directory.php?id=4 to directory/category/city/name/4/ I took a stab in the dark with RewriteRule ^directory/*/*/*/([^/\.]+)/?$ directory.php?&id=$4 But not working obviously. Any help is greatly appreciated ...

Apache Options -Indexes configuration not working

I need to stop directory listing of images directory on a website. I'm configuring cookieless domain for images and javascripts on a site. I have done the CNAME configuration and added below virtual hosts configuration in httpd.conf file. But, if i access this cookieless domain directly, its listing the whole directory content. how to so...

Starting Apache service with a variable that can be later accessed via PHP?

Hi, I have a need to start the Apache service with a parameter so that I can later access that parameter via PHP. Is this possible? ...

ySlow, Mod Deflate, cPanel Website Optimizer & Javascript.

Hello, I just got around to installing mod_deflate on my server. I also added the following to my Website Optimizer in cPanel: text/html text/plain text/xml text/css text/js text/javascript Now, the site shows considerable improvement in loading time (almost 3x!), but ySlow is still giving me an "E" rating for "Compress Components wit...

Ways to overcome PHP/MySQL + Ajax/comet/long polling?

I have existing websites with PHP/MySQL framework. They are very busy and chat, events, vs (interval) ajax implementations added to server load as well. Now websites are going bigger so I need to change to long polling/comet but apache is not very well with these and most of the comet servers are done in Java. Like cometd, www.stream-hub...

Apache Rewrite RULE

Ok can some one tell me what is wrong with this, i know it seems stupid but it is not working RewriteEngine On RewriteRule ^(/mapa/mapa.htm) htp://www.domain.com/map i also try RewriteEngine On RewriteRule ^(/mapa/mapa\.htm) htp://www.domain.com/map any ideas ? ...

PHP Out of Memory - Crashes Apache?

Hello all, I am running PHP version 5.3.0 and Apache: 2.2.11 When I run PHP scripts that consume a lot of memory (I think) - large loops etc. My Apache web server reports a crash?! [Sat Jan 02 00:51:30 2010] [notice] Parent: child process exited with status 255 -- Restarting. Do I need to increase memory somewhere? I currently have ...

What is CGI and what are CGI Scripts?

Ive seen a folder called cgi-bin quite long while using apache. How do scripts help me? how can i use them? I've used php and ajax only for web development! ...

How does Django + mod_wsgi affect the python path?

I have a simple setup with my python libraries in /domains/somedomain.com/libs/ and all my tests run fine. I start WSGI with DJANGO_SETTINGS_MODULE to "somedomain.settings" where somedomain is a package in libs/ Suddenly, when adding pywapi.py into libs/ I can't import it when hitting the site. But, if I add 'import pywapi' to my wsgi s...

How to hide the .html extension with Apache mod_rewrite

I have a small number of static sites where I simply want to hide the .html extension: the url /foo fetches the static file /foo.html the browser still displays the url /foo The client can then send out bookmarks in the style mydomain.com/foo rather than mydomain.com/foo.html. It sounds very simple, and I've used mod_rewrite happily...

Simple htaccess rules for clean URLs not showing static media

After looking at 4-5 different ways to get simple clean URLs for static files, we found one that was simple and easy to implement/maintain over multiple folder and files. One problem, it wont load the js/css/images from that folder it is looking at. Here is the rule - it loads the html ok, but not the images, etc which are in the /ima...

Difficulties with .htaccess and Blocking Specific File Extensions

Hey all, I have a rather complicated situation where I run a personal blog where every Friday and Sunday, I will post up music on the blog by uploading the mp3s into a folder, where a Flash mp3 player accesses it and plays it for the world. Recently, some website called Dizzler, which is like a spider for mp3 files (Like the ones I hos...

Why would index.php only work some of the time?

I just moved a develoment site onto a test production server and I'm testing some things out. When you go to the root URL (ie rooturl.com), the browser is correctly rendering rooturl.com/index.php without showing the index.php in the address bar. However, I also have a directory at rooturl.com/admin that also has an index file of index...

Setting up a basic web proxy in apache

Hi, I'm looking to run Apache as a proxy for web development. I'm running Mac OS X 10.5.4, which already has Apache 2.2.8 installed and running. I'd like to point my JavaScript files (which are running locally on my machine) to: http://localhost/test.php which would hit the local apache server, then have that apache instance forward...