Results 1 to 10 of 10
Thread: Weird Apache behaviour
-
02-18-2008, 04:57 AM #1Web Hosting Master
- Join Date
- Jun 2002
- Posts
- 1,060
Weird Apache behaviour
I found something very strange.
On a busy server, apache sometimes is showing other pages than what was requested.
Let me make it clearer:
- I request Page A, a totally different page is showing up
- then I request Page B, Page A is showing up!
- then I request Page C, Page B is showing up!
So, it is actually delaying the requests with one step. This is happening until I restart Apache server.
I usa CGI scripts (perl) and mod_deflate compression + mod_rewrite. What is odd is that this is appearing on 2 servers with different Apache versions so I am not even sure this is an apache problem.
Actually all my pages are served like this: myurl.com/myscript.cgi?a=b&c=d, this is presented like myurl.com/myscript.cgi/a/b/c/d/.
Any comments?
-
02-18-2008, 05:49 AM #2Web Hosting Master
- Join Date
- Oct 2004
- Location
- Kerala, India
- Posts
- 4,771
Have a check of the redirection rules again. It seems like, some of the rules are causing the issue.
David | www.cliffsupport.com
Affordable Server Management Solutions sales AT cliffsupport DOT com
CliffWebManager | Access WHM from iPhone and Android
-
02-18-2008, 06:00 AM #3Web Hosting Master
- Join Date
- Jun 2002
- Posts
- 1,060
The thing is that I can not disable the rewrite rules for a long time, otherwise my entire linking structure is messed up.
However, I did a test. When this problem appeared I tried to access pages without redirection, so I used the normal myyurl.com/myscript.cgi?a=b&c=d and the same thing happened. Any more thoughts?
-
02-18-2008, 07:25 AM #4Web Hosting Master
- Join Date
- Oct 2004
- Location
- Kerala, India
- Posts
- 4,771
Any global rewrite option set in web server config?
David | www.cliffsupport.com
Affordable Server Management Solutions sales AT cliffsupport DOT com
CliffWebManager | Access WHM from iPhone and Android
-
02-18-2008, 08:57 AM #5Web Hosting Master
- Join Date
- Jun 2002
- Posts
- 1,060
I use a script to transform the urls. Is there an easier rule to simply replace & and = with /?
-
02-18-2008, 12:50 PM #6Web Hosting Master
- Join Date
- Jun 2002
- Posts
- 1,060
Also, what do you mean by "global rewrite option"? In httpd.conf?
-
02-19-2008, 03:06 AM #7Web Hosting Master
- Join Date
- Oct 2004
- Location
- Kerala, India
- Posts
- 4,771
We can try rewrite rule in .htaccess. Paste here an example url that you need to be rewritten with the resulting url also.
input url --> output url
Global rules means that are written outside the VH entry inside httpd.conf.David | www.cliffsupport.com
Affordable Server Management Solutions sales AT cliffsupport DOT com
CliffWebManager | Access WHM from iPhone and Android
-
02-19-2008, 03:40 AM #8Web Hosting Master
- Join Date
- Jun 2002
- Posts
- 1,060
I have this linking structure:
myurl.com/scrip.cgi?a=b&c=d&....x=y
What I do is simply rewrite the query string and present the URL like this:
myurl.com/scrip.cgi/a/b/c/d/..../x/y/
How do I write the rule for this in htacess? I currently use a script for this. Any more simple method?
-
02-19-2008, 12:51 PM #9Web Hosting Master
- Join Date
- May 2006
- Location
- India
- Posts
- 661
Put this ruleset it in your .htaccess file.
Code:RewriteEngine On RewriteRule ^/script.cgi/(.*)/(.*)/$ /script.cgi/$1=$2 RewriteRule ^/script.cgi/(.*)/(.*)/(.*)/(.*)/$ /script.cgi/$1=$2&$3=$4 RewriteRule ^/script.cgi/(.*)/(.*)/(.*)/(.*)/(.*)/(.*)/$ /script.cgi/$1=$2&$3=$4&$5=$6
██ SparkSupport.Com - The Premier Tech Company
██ Cloud Solutions|Email Infra setup|VOIP|Video Streaming|Software Development
██ Email: info@sparksupport.com █ Phone : 1- 408-600-1449 | Skype : shijils
-
02-19-2008, 04:58 PM #10Web Hosting Master
- Join Date
- Jun 2002
- Posts
- 1,060
I assume you meant this:
RewriteEngine On
RewriteRule ^/script.cgi/(.*)/(.*)/$ /script.cgi?$1=$2
RewriteRule ^/script.cgi/(.*)/(.*)/(.*)/(.*)/$ /script.cgi?$1=$2&$3=$4
RewriteRule ^/script.cgi/(.*)/(.*)/(.*)/(.*)/(.*)/(.*)/$ /script.cgi?$1=$2&$3=$4&$5=$6
However, with these changes only the first rule is working, the rest displays simply the script.cgi. What can be wrong?