Results 1 to 10 of 10
  1. #1
    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?

  2. #2
    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

  3. #3
    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?

  4. #4
    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

  5. #5
    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 /?

  6. #6
    Join Date
    Jun 2002
    Posts
    1,060
    Also, what do you mean by "global rewrite option"? In httpd.conf?

  7. #7
    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

  8. #8
    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?

  9. #9
    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
    The code given should work for 2, 4 and 6 arguments. If you want it for 8, 10 and so , add more rules accordingly.
    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

  10. #10
    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?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •