Re: WordPress .htaccess rewrite issue between httpd versions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



That did the trick. Thanks, Frank!

On 9/21/22 15:14, Frank Gingras wrote:
*WARNING: *This email originated external to the NMSU email system. Do not click on links or open attachments unless you are sure the content is safe.

You don't need to use mod_rewrite here, just use:

FallbackResource /site1/index.php
DirectoryIndex /site1/index.php

On Wed, 21 Sept 2022 at 16:37, Mark Leisher <mleisher@xxxxxxxxxxx <mailto:mleisher@xxxxxxxxxxx>> wrote:

    I hope this is the right list to bring things like this up.

    I'm running into a rewrite loop problem with a WordPress .htaccess file
    that might be related to the httpd version, but I don't see anything
    relevant searching online yet.

    I have two systems, CentOS (httpd 2.4.6) and Almalinux (httpd 2.4.51),
    running web servers with exactly the same configuration. The only
    difference is the server on Almalinux sends PHP files to php-fpm
    (ProxyPassMatch ^/(.*\.php)$ fcgi://127.0.0.1:9000/wpsites/$1
    <http://127.0.0.1:9000/wpsites/$1>).

    On CentOS, no rewrite loops occur.

    On Almalinux:
        1. Visiting https://wp.example.com/site1/
    <https://wp.example.com/site1/> produces an endless rewrite
    loop (see below).
        2. Visiting https://wp.example.com/site1/index.php
    <https://wp.example.com/site1/index.php> works correctly.

    Any help appreciated!

    ------------------------------------------------------------------

    Default WordPress 6.0.2 .htaccess file on both systems in
    /wpsites/site1/:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    RewriteBase /site1/
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /site1/index.php [L]
    </IfModule>

    CentOS rewrite log entries
    --------------------------
    strip per-dir prefix: /wpsites/site1/ ->
    applying pattern '^index\\.php$' to uri ''
    strip per-dir prefix: /wpsites/site1/ ->
    applying pattern '.' to uri ''
    pass through /wpsites/site1/
    strip per-dir prefix: /wpsites/site1/index.html -> index.html
    applying pattern '^index\\.php$' to uri 'index.html'
    strip per-dir prefix: /wpsites/site1/index.html -> index.html
    applying pattern '.' to uri 'index.html'
    rewrite 'index.html' -> '/site1/index.php'
    trying to replace prefix /wpsites/site1/ with /site1/
    strip per-dir prefix: /wpsites/site1/index.php -> index.php
    applying pattern '^index\\.php$' to uri 'index.php'
    pass through /wpsites/site1/index.php

    Almalinux rewrite log entries (repeats ad infinitum)
    ----------------------------------------------------
    strip per-dir prefix: /wpsites/site1/ ->
    applying pattern '^index\\.php$' to uri ''
    strip per-dir prefix: /wpsites/site1/ ->
    applying pattern '.' to uri ''
    pass through /wpsites/site1/
    strip per-dir prefix: /wpsites/site1/ ->
    applying pattern '.*' to uri ''
    strip per-dir prefix: /wpsites/site1/ ->
    applying pattern '^index\\.php$' to uri ''
    strip per-dir prefix: /wpsites/site1/ ->
    applying pattern '.' to uri ''
    pass through /wpsites/site1/

-- Mark Leisher

    ---------------------------------------------------------------------
    To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
    <mailto:users-unsubscribe@xxxxxxxxxxxxxxxx>
    For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx
    <mailto:users-help@xxxxxxxxxxxxxxxx>


--
Mark Leisher

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx




[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux