apache

Htaccess rule to redirect domain to index.html

How do I write a rewrite-rule that redirects visitors to the domain www.mydomain.com/ to www.mydomain.com/index.html? ...

PHPIniDir broken under windows 7?

I had a server running on a windows xp machine using apache2 with php and mysql. I've recently upgraded to windows 7 and have been having trouble getting it to work. Apache works fine and php works, but I can't seem to get it to work with a php.ini file. When I set PHPIniDir to a directory with a php.ini file, the Apache service does NO...

mysql random value change

I have a database in mysql with 1 table composed by 5 fields. Two of these fields are FLOAT and generated by RAND function; now i want to change these values each x time, for example numeric values have to change every 0.01 s to simulate a financial market. Is there a method to do this thing? Thanks ...

Problem with function session_start() (works slowly).

Hi. I have a problem wtih session_start() on primary server. When I load page for the first time, it takes less than 1 second to complete request. If I'll wait for approximately 12-15 seconds and then reload page, time of loading will be the same. But when I'm trying to refresh page after, for example, 3 or 5 seconds after initial loadi...

Apache rewrite condition and the absence of characters

We have the following mod_rewrite condition/rule but it is returning a 404 error on URLs that merely begin "i" (or "css" for that matter) if they do not equate precisely to our corresponding directories (/i /css etc.) RewriteEngine on RewriteCond $1 !^(index\.php|robots\.txt|/(i|css|design_and_docs|js|test)/*) RewriteRule ^(.*)$ /index....

rewritemap not matching

Hi I'm having trouble with my rewritemap not matching things: RewriteMap map txt:rewritemaps\map.txt [NC] RewriteCond ${map:$1|NOT_FOUND} !NOT_FOUND [NC] RewriteRule ^(.+)$ ${map:$1} [NC, R=301] The map has about 4,500 entries, including: arctic /Destinations/Polar-Regions/The-Arctic.aspx My RewriteLog, set to level 9, logs: i...

Apache 2 Windows rotatelogs help

I've been trying to use rotatelogs.exe on Windows Server 2k to rotate the access.log. But whenever I restart apache it gets an error when reading http.conf Here is the line: CustomLog "|D:\Apache2\Apache2\bin\rotatelogs.exe D:\Apache2\Apache2\logs\access.log 86400” common I don't know why it's not working. The paths are correct, comm...

Apache comes back with nothing

Hello - I'm running Apache 2.046 with PHP 5.x and I am experiencing very odd behavior on a CodeIgniter app. The frustrating thing is that it is not consistent. Occasionally when I call up my app Apache returns nothing. I mean nada. But then I hit refresh and everything works as expected. Sometimes I have to hit "refreash" several ...

Apache 2.2, (MOD) SSL and Mod Rewrite via .htaccess

Hello What i want to do is the following, 1) Prevent normal non secure pages being shown as secure 2) Prevent secure pages being shown as normal non secure pages 3) Show secure pages as is, as specified by their links Also note there are, ie ./contact/subscribe which is secure but not ./contact/welcome. I have tried several conditions...

Problem with .htaccess, rewrite rule.

Hey guys! I have a page with a RewriteRule that makes my code: /?p=page will be rewritten like: abc.com/page, but I really want to have more sites under that, and at the moment I have this code in my .htaccess file. Right now I have the code: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILE...

How to handle all URLs from 1 page using PHP?

I would like to redirect all urls from the webpage (what ever what's after the domain name) to a single webpage that will analyse the complete url and will show the good page and information. I know it's possible with Mod_Rewrite and using some PHP function to get the URL but I can't find any good webpage showing the steps and how to do ...

Content Fetching Using htaccess

Let I have two domains named www.abc.example and www.xyz.example hosted in different servers. I have a .htaccess file in the root directory of www.abc.example (i.e. www.abc.example/.htaccess) What will be the .htaccess script if I want to load the contents of www.xyz.example when I request from www.abc.example. As for example: If I br...

Properly navigating relative local paths in PHP

I'm having trouble specifically with the getimagesize function. I'm making the function call from /item/ajax/image.php relative to the domain's HTTP root. I'm trying to get the dimensions of an image stored at /portfolio/15/image.jpg. From what I understand, the function takes a filename as an argument, so I tried the following: getimag...

How can I run multiple Apache 2 instances on Ubuntu?

I have two different config files (server1.conf & server2.conf). I need to use each of them to spawn an instance of apache. /etc/init.d/apache2 start does let me specify which config file apache uses, it defaults to apache2.conf. apache2ctl -f /etc/apache2/server1.conf -k start works, but when I try to spawn another instance it says t...

How does URL rewriting work?

Hey everyone, I am new to URL rewriting and I have an .htaccess file that looks like this: RewriteEngine On RewriteRule /*\.(css|js|gif|png|jpe?g)$ - [NC,L] RewriteRule "^(.*)$" "www/index.php?_url=$1" [QSA,L] Does this code just rewrite the code internally, or is it supposed to change to URL in the address bar? As of now it ...

How to disable mod_deflate in apache2?

How can I disable mod_deflate in Apache2 For files in a specific directory OR For all files that have extension of, for example .py? ...

Strategies for dealing with URIs when building an application that sits behind a reverse proxy

I'm building an application with a self-contained HTTP server which can be either accessed directly, or put behind a reverse proxy (like Apache mod_proxy). So, let's say my application is running on port 8080 and you set up your Apache like this: ProxyPass /myapp http://localhost:8080 ProxyPassReverse /myapp http://localhost:8080 Th...

Content Dispostion header set in PHP not working with Firefox

I have a form button that submits the data to generic script (the same page that the form is loaded from, index.php) and if the right POST variables are submitted to that script, it returns a PDF for the user to print (with the relevant form info loaded, and other DB info, etc). The problem is that no matter what I set the content-type ...

How to view error messages from ruby CGI app on remote server?

I have written a Ruby (not Rails) app which generates web pages. The script is installed on a linux web server and is called up by apache using CGI in response to HTTP requests. Pretty standard stuff. When I am running it on my own computer I look at the apache error log to see the ruby error messages. However, on the host that I use ...

apache + mod_wsgi + aspell-python on OS X 10.5.8

I have a website that processes user submitted documents in a variety of ways, one of which is to do a spell check on a part of each document. When I set this website up on a Mac Mini (yes, I realize that's a pretty weak piece of equipment for a website, but it's internal and no one outside the office sees it), I remember having some tr...