apache

Apache mod_rewrite, redirect to an URL when a file with a particular extension is requested

Hi! I would like to use mod_rewrite to transform a URL like this one: http://example.com/qxs/app/myapp.qxs into http://example.com/qxs/index.php?page=myapp Currently I have this: Options +FollowSymlinks RewriteEngine on RewriteRule ^app/([^/\.]+).qxs /qxs/index.php?page=$1 [L] But this ends up in an endless loop or something ca...

Browser language based 404 pages with mod_rewrite how to

I am trying to generate language dependant 404 (also other errors) pages purely based on Apache mod_rewrite rules by evaluating the clients HTTP Accept-Language header. I've managed to show the correct pages (english default) with this rules: RewriteEngine on RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{SCRIPT_FILENA...

How to setup PHP to be a "pipe" for downloads from another location?

I'm wanting to setup a php script and host it on my server that will let me download files from other locations, but making it look like it's coming from my server. Maybe using curl or htacess. Also I was hoping that there would be a way to get around having my server deal with the bandwidth. Does that make sense? Is this doable? --...

Should mod_proxy_ajp or mod_jk be used for a production environment?

I've been searching over the past few days of whether I should use mod_proxy_ajp or mod_jk to connect apache httpd and tomcat. All the sites I find are a few years old and outdated. So, which is best to use for a proper production environment? Is mod_proxy_ajp mature enough to entirely replace mod_jk, or is mod_jk still best if you can ...

Removing Tomcat context from URLs for a virtual host (mod_jk, mod_rewrite)

Hi All, I have a single Tomcat instance containing a number of webapps, each accessible via it's /Context. Tomcat is behind httpd (actually Debian Apache2), configured with virtual hosts to serve each app/Context. Tomcat connectivity is with mod_jk. This works fine when I don't care about removing the context from urls: when the root ...

Apache routing to ISS - SSL Port issue

How things works (or should): We have lots of clients apps set on IIS but Apache is the one that receives all conections (from port 443) and redirect them to the corresponding port on the IIS server. The problem is: our application is building the URLs based on the IIS port (final port) instead of Apache's (default 443) one, even tho t...

Unknown Authn provider: wsgi ... fail!

I have working wsgi authentication on another server, however a second server is not accepting the same configuration and errors upon reload with the message: Syntax error on line 12 of /etc/apache2/sites-enabled/mydomain.com Unknown Authn provider: wsgi ... fail Here is the relevant portion of the config file (line 12 is WSGIAuth...

Apache Rewrite Rule Regex Problem

So I have an Apache .htaccess file that contains this: RewriteEngine On RewriteRule ^/(javascript/.*)$ /$1 [L] RewriteRule ^/(styles/.*)$ /$1 [L] RewriteRule ^.*$ /index.php Unfortunately, the last line's coughing up a 500 error on the server that we've moved the code to. It works fine on my machine, Ubuntu 9.10 running Apache 2.2.12,...

Apache: Control access with .htaccess file to a directory

I am trying to restrict access to a directory in my shared hosting account on GoDaddy. Basically, that means I have no access to the httpd.conf file for their Apache server, so I have to use .htaccess files to control access to everything. I have two domains on the shared hosting account, which we'll call domainA.com (the main domain), ...

Is there a way to force traffic comin from www.abc.com to go to abc.com via htaccess or dns?

I am having some trouble with a flash file that has hardcoded urls in it. The flash loads fine if I visit from abc.com. But if I try to view it from www.abc.com it wont load. So my question is, how do I got about forcing all traffic, including that coming from www.abc.com to be directed to abc.com instead. ...

mod_rewrite convert certain folders to parameters

Hi I have a site where I'd like to convert the first subfolder into a parameter (from a set list of subfolders), so http://localhost/mysite/folder1/dosomething.php is displayed as shown above, but to PHP it looks like: ... localhost/mysite/dosomething.php?organisation=folder1 I only need to do this on certain folders (i.e. not ... l...

2 connections per server?

i´ve read somewhere that you can just have 2 connections (eg. ajax requests) to the same server. is this correct? so you can´t run 3 ajax requests simultaneously? what will happen to the 3rd one? and if I´ve got one iframe, then i can just run 1 ajax request at the time? what is the easiest way to get around this? what keywords could...

Additional server between closed source client/server that does same requests but does not change data

I have the following setup: Closed-source Client A where I can set the IP of B Closed-source Server B, fixed IP Server C, written by me A communicates with B over HTTP. I've cloned the API and implemented it myself in C, as I am interested in the data, but I still require A to talk to B, which is why I can't just let the client conne...

htaccess conditional statements based on server name/path

Is it possible to write some conditional "if" statements in htaccess based on the server name/path? I know I can use <IfModule> but that doesn't solve the problem when the development and production server are identical. thanks ...

Can you configure a single folder in a WordPress install that will allow directory list contents

Hello, I have a WordPress installation. I would like to have one folder in the file structure where the url will show you the files and folders and allow you to browse and download from there. Can it be done? Seth ...

How output buffering blocks in PHP/Apache works?

Hello. Suppose I am echoing random data from PHP to browser. Total amount of random data is about XGb and echo is done in YKb chunks. ob_start() is not used. Will echo calls block after PHP and Apache buffers are full (client is not capable of consuming data with the same speed it is generated)? If so, how much in size PHP and Apache bu...

Speed of RewriteRule?

I have a site that is roughly one half "my" site, and one half a SAS site from a third party. We've been trying to tackle a single sign on method for many moons. It dawned on me recently that if I did some URL rewriting to display the third party site, but appear on our domain, the third party cookies would be written as coming from my...

Maintain HTTP Referer

Hey, I've setup some redirects on an Apache server. They look at bit like this: Redirect /Name/register /login.html My question is this... is there anyway to preserve the HTTP Referrer through this redirect? It would seem that by default, Apache discards the information. I would really like it if after the redirect was complete the re...

Apache file caching

How does apache handle caching of certain files, and is it possible to explicitly say that certain files should be aggressively cached more than others, through the standard config files for a given host or virtualhost? To put it in context, I keep a lot of site content in various XML files, and I'd like to be able to say that this fil...

website hostname and docroot

Is there a way in PHP to get the hostname and document root from the server? I'd like to do this without storing them as variables in your php code. I am reluctant to use $_SERVER because I have heard it is not reliable and subject to attack. How can this be done on a virtual host? Does a reliable and safe method exist? ...