Welcome! Log In Create A New Profile

Advanced

Problem with mod_rewrite when using trailing forward slash

Posted by dbn 
Hi,

I have configured a server for shared hosting using apache,
mod_fastcgi and php-fpm.
Everyting seems to work fine, just not when using full_path for search
engine optimization.

Apache i version 2.2.16
PHP is version 5.2.14
mod_fastcgi is version 2.4.6

This is an example of my .htacces file

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ index.php/$1 [L]

and this is the virtualhost configuration

FastCgiExternalServer /usr/data/www/domain.ext/.virtual_html/docs -
socket /usr/data/www/.fpm-sockets/domain.ext.sock
AddHandler php-fastcgi .php .phtml .php4 .php5 .php3
Action php-fastcgi /virtualhtml
Alias /virtualhtml /usr/data/www/domain.ext/.virtual_html/docs/

When I call this url: domain.ext/pagename it should redirect the
request to index.php/pagename, but instead I get a 404 error message.
"No input file specified"

Anybody know how to make this work ? I've been searching google, but
unfortunately with no usefull result..

Thanks in advance. Daniel
Re: Problem with mod_rewrite when using trailing forward slash
November 30, 2010 06:56PM
On Tue, Nov 30, 2010 at 7:15 AM, dbn <dbn@bielefeldtsolutions.dk> wrote:

> When I call this url: domain.ext/pagename it should redirect the
> request to index.php/pagename, but instead I get a 404 error message.
> "No input file specified"

well no input specified means its hitting the PHP interpreter, and
most of the time its because the file doesn't exist or SCRIPT_FILENAME
or whatever PHP needs to know to load the file is incorrect.

use nginx. :)
Daniel Bielefeldt
Re: Problem with mod_rewrite when using trailing forward slash
December 01, 2010 01:18AM
Den 01/12/10 00.55, Michael Shadle skrev:
> On Tue, Nov 30, 2010 at 7:15 AM, dbn <dbn@bielefeldtsolutions.dk> wrote:
>
>> When I call this url: domain.ext/pagename it should redirect the
>> request to index.php/pagename, but instead I get a 404 error message.
>> "No input file specified"
>
> well no input specified means its hitting the PHP interpreter, and
> most of the time its because the file doesn't exist or SCRIPT_FILENAME
> or whatever PHP needs to know to load the file is incorrect.
>
> use nginx. :)

Well, I was hoping for an answer that could help me getting further with
my apache configuration :) I don't have any experience with nginx, and I
dought my users think it's a good idea to change, as they rely on
..htaccess features in apache.

Anyhow, why do you mean that nginx can do a better job when running
php-fpm ?
Re: Problem with mod_rewrite when using trailing forward slash
December 01, 2010 01:26AM
On Tue, Nov 30, 2010 at 10:16 PM, Daniel Bielefeldt
<dbn@bielefeldtsolutions.dk> wrote:

> Well, I was hoping for an answer that could help me getting further with
> my apache configuration :) I don't have any experience with nginx, and I
> dought my users think it's a good idea to change, as they rely on
> .htaccess features in apache.
>
> Anyhow, why do you mean that nginx can do a better job when running
> php-fpm ?

Not really. They do typically go hand in hand though. However if you
need htaccess support, and it's not just for PHP overrides that you
could use htscanner for (or php 5.3 equivalents) then you might be
stuck with apache.

I just saw the config and it annoyed me because I loathe Apache :) I
tried to give as much help as I could initially. I just had to throw
in a shout out for nginx at the end.
Hi..maybe you can try this

in your latest line of apache config
Alias /virtualhtml /usr/data/www/domain.ext/.virtual_html/docs

remove the latest "/"
hope it works.

On Nov 30, 11:15 pm, dbn <d...@bielefeldtsolutions.dk> wrote:
> Hi,
>
> I have configured a server for shared hosting using apache,
> mod_fastcgi and php-fpm.
> Everyting seems to work fine, just not when using full_path for search
> engine optimization.
>
> Apache i version 2.2.16
> PHP is version 5.2.14
> mod_fastcgi is version 2.4.6
>
> This is an example of my .htacces file
>
> RewriteEngine on
> RewriteCond %{REQUEST_FILENAME} !-f
> RewriteCond %{REQUEST_FILENAME} !-d
>
> RewriteRule ^(.*)$ index.php/$1 [L]
>
> and this is the virtualhost configuration
>
> FastCgiExternalServer /usr/data/www/domain.ext/.virtual_html/docs -
> socket /usr/data/www/.fpm-sockets/domain.ext.sock
> AddHandler php-fastcgi .php .phtml .php4 .php5 .php3
> Action php-fastcgi /virtualhtml
> Alias /virtualhtml /usr/data/www/domain.ext/.virtual_html/docs/
>
> When I call this url: domain.ext/pagename it should redirect the
> request to index.php/pagename, but instead I get a 404 error message.
> "No input file specified"
>
> Anybody know how to make this work ? I've been searching google, but
> unfortunately with no usefull result..
>
> Thanks in advance. Daniel
On 1 Dec., 08:07, Ben <benppt...@gmail.com> wrote:
> Hi..maybe you can try this
>
> in your latest line of apache config
> Alias /virtualhtml /usr/data/www/domain.ext/.virtual_html/docs
>
> remove the latest "/"
> hope it works.

Thanks, but it didn't work :(
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 173
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready