You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "Adolph, Tobias" <To...@lrz.de> on 2015/07/22 18:10:54 UTC

[users@httpd] AW: Rewrite, .php files and PHP-FPM

Do you use php via mod_proxy_fcgi?


Could be possible that the .htaccess file is never honoured since the request was proxied before.


Kind regards,

Tobias Adolph


Von: Rose, John B <jb...@utk.edu>
Gesendet: Mittwoch, 22. Juli 2015 17:05
An: users@httpd.apache.org
Betreff: [users@httpd] Rewrite, .php files and PHP-FPM

Red Hat 7
Apache 2.4
PHP-FPM

We are having some trouble getting Rewrite to work with Apache 2.4/PHP-FPM

In other words, it isn't successfully working.


Our test example:

The .htaccess file:


<IfModule mod_rewrite.c>

    RewriteEngine On

    RewriteRule ^index2.html$ index.html

    RewriteRule ^index2.php$ index.php

</IfModule>


Here is the content of index.php(In other words that is the text in the file, in addition to being the name):

"index.php"


Here is the content of index2.php:

"index2.php"


If we go to index2.php, we get "index2.php" which indicates the mod_rewrite is not working on php request.


Any suggestions on addressing the above problem?

Thanks

Re: [users@httpd] AW: Rewrite, .php files and PHP-FPM

Posted by Daniel <df...@gmail.com>.
"If we go to index2.php, we get "index2.php" which indicates the
mod_rewrite is not working on php request."

Not only it IS working, it is working as intended.

If you don't add the R flag you are doing an "internal" redirection.

http://httpd.apache.org/docs/current/rewrite/flags.html#flag_r

By the way, why don't you use Redirect/RedirectMatch for such simple
redirects? specially since you want external redirections.

2015-07-22 18:10 GMT+02:00 Adolph, Tobias <To...@lrz.de>:

> Do you use php via mod_proxy_fcgi?
>
>
> Could be possible that the .htaccess file is never honoured since the
> request was proxied before.
>
>
> Kind regards,
>
> Tobias Adolph
>
>
> *Von:* Rose, John B <jb...@utk.edu>
> *Gesendet:* Mittwoch, 22. Juli 2015 17:05
> *An:* users@httpd.apache.org
> *Betreff:* [users@httpd] Rewrite, .php files and PHP-FPM
>
> Red Hat 7
> Apache 2.4
> PHP-FPM
>
> We are having some trouble getting *Rewrite* to work with *Apache
> 2.4/PHP-FPM*
>
> In other words, it isn't successfully working.
>
>
> Our test example:
>
> The .htaccess file:
>
>
> *<IfModule mod_rewrite.c>*
>
> *    RewriteEngine On*
>
> *    RewriteRule ^index2.html$ index.html*
>
> *    RewriteRule ^index2.php$ index.php*
>
> *</IfModule>*
>
>
> Here is the content of index.php(In other words that is the text in the
> file, in addition to being the name):
>
> "index.php"
>
>
> Here is the content of index2.php:
>
> "index2.php"
>
> If we go to index2.php, we get "index2.php" which indicates the
> mod_rewrite is not working on php request.
>
>
> Any suggestions on addressing the above problem?
>
> Thanks
>



-- 
*Daniel Ferradal*
IT Specialist

email         dferradal at gmail.com
linkedin     es.linkedin.com/in/danielferradal