Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8444995
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T09:32:38+00:00 2026-06-10T09:32:38+00:00

I’m at my wits’ end… I’m trying to do something simple, yet I can’t

  • 0

I’m at my wits’ end… I’m trying to do something simple, yet I can’t understand what is going wrong…

I’m simply trying to take all requests to the domain, and route them to index.php

EDIT for clarity: index.php acts as a dispatcher for the request, as part of a framework.

I’ve got this working on my local machine without problems, but on the server (VPS Linux with Plesk) I’m having all sorts of problems…

EDIT for clarity: These rules are defined in the vhost.conf config file for the virtual host.

Here’s the mod_rewrite:

<IfModule rewrite_module>
    RewriteEngine On
    RewriteRule ^/.* /index.php
</IfModule>

Here’s the apache error log when I attempt to go to “www.mydomain.com/home/index” (for example):

[debug] core.c(3072): [client xxx.xxx.xxx.xxx] r->uri = /phppath/cgi_wrapper/phppath/cgi_wrapper/phppath/cgi_wrapper/home/index
[debug] core.c(3078): [client xxx.xxx.xxx.xxx] redirected from r->uri = /phppath/cgi_wrapper/phppath/cgi_wrapper/home/index
[debug] core.c(3078): [client xxx.xxx.xxx.xxx] redirected from r->uri = /phppath/cgi_wrapper/home/index
[debug] core.c(3078): [client xxx.xxx.xxx.xxx] redirected from r->uri = /home/index

As you can see from the trace, it seems to redirect the /home/index to /phppath/cgi_wrapper/ which then seems to get passed on again to /phppath/cgi_wrapper/phppath/cgi_wrapper/home/index, and so on until the maximum internal redirects is reached.

An HTTP 500 is sent to the browser.

Further EDIT – extra information. From what I can make out from the way Plesk scatters its files about, these are the only two lines which have an effect on the virtual host. I think it’s probably that Action statement… can I override it somehow in the vhost.conf?

in php-cgi.conf:
ScriptAlias /phppath/ "/var/www/cgi-bin/cgi_wrapper/"
Action php-script /phppath/cgi_wrapper

in php.conf:
AddHandler php5-script .php

Further EDIT: Found this within a dynamically generated conf file (at vhost level).

<Files ~ (\.php)>
    SetHandler None
    AddHandler php-script .php
    Options +ExecCGI
    allow from all
</Files>

Has anyone got any ideas as to what’s happening? I’ve been pulling my hair our for two days… Thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T09:32:39+00:00Added an answer on June 10, 2026 at 9:32 am

    After much tearing of hair, and gnashing of teeth, and three keyboards later… I’ve managed to find something that works. It’s not pretty, but it does the job… If anyone can offer any improvements on this, please do – I’m all ears. Or eyes. As it were.

    So, I first noticed that recurring /phppath/cgi_wrapper/home/index problem in the Apache Log, which got me thinking: “Maybe I shouldn’t be passing /home/index to the PHP CGI, but I should be passing index.php“. So, I modified the Rewrite as follows:

    <IfModule rewrite_module>
        RewriteEngine On
        RewriteLog /blah/blah/blah/rewrite_log
        RewriteLogLevel 5
    
        RewriteRule ^.*$ /index.php [PT]
    </IfModule>
    

    I’ve simply added the PassThrough (PT) flag, which according to the documentation passes the rewrite result through to the handler.

    This got me the following apache error_log:

    [debug] core.c(3078): [client xxx.xxx.xxx.xxx] redirected from r->uri = /index.php
    [debug] core.c(3078): [client xxx.xxx.xxx.xxx] redirected from r->uri = /index.php
    [debug] core.c(3078): [client xxx.xxx.xxx.xxx] redirected from r->uri = /index.php
    

    which I considered an improvement, but it still wasn’t working.

    So then I went to my sparkly new rewrite_log to see if this could illuminate me. I saw:

    xxx.xxx.xxx.xxx - - [28/Aug/2012:15:38:05 +0400] [www.mydomain.com/sid#7f3c39001360][rid#7f3c390bbc88/initial] (2) rewrite '/' -> '/index.php'
    xxx.xxx.xxx.xxx - - [28/Aug/2012:15:38:05 +0400] [www.mydomain.com/sid#7f3c39001360][rid#7f3c390bbc88/initial] (2) forcing '/index.php' to get passed through to next API URI-to-filename handler
    xxx.xxx.xxx.xxx - - [28/Aug/2012:15:38:05 +0400] [www.mydomain.com/sid#7f3c39001360][rid#7f3c390c2710/initial/redir#1] (2) init rewrite engine with requested uri /phppath/cgi_wrapper/index.php
    xxx.xxx.xxx.xxx - - [28/Aug/2012:15:38:05 +0400] [www.mydomain.com/sid#7f3c39001360][rid#7f3c390c2710/initial/redir#1] (3) applying pattern '^/(.*)$' to uri '/phppath/cgi_wrapper/index.php'
    

    So, from this I deduced that I was having the same problem: /phppath/cgi_wrapper/index.php was now being passed into the rewrite engine again to be rewritten, and this was coming out with /index.php again, which was being passed back in, and etc. etc.

    So I added a condition. (This is the bit which seems ugly to me; I’m sure there’s a better way):

    <IfModule rewrite_module>
        RewriteEngine On
        RewriteLog /blah/blah/blah/rewrite_log
        RewriteLogLevel 5
    
        RewriteCond ${REQUEST_URI} !^/phppath
        RewriteRule ^.*$ /index.php [PT]
    </IfModule>   
    

    That RewriteCond is basically saying: Apply the following rule if the request does NOT begin with /phppath.

    And that’s it. Now it’s working; all requests are being handled by index.php, as required.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I have a jquery bug and I've been looking for hours now, I can't
Basically, what I'm trying to create is a page of div tags, each has
I am doing a simple coin flipping experiment for class that involves flipping a
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.