• Resolved doodguy

    (@doodguy)


    We are self hosting on a dedicated Linux machine using Apache 2.4
    Our wordpress site is installed into $DocumentRoot/wordpress
    Wordpress Address is https://bl1231.als.lbl.gov/wordpress
    Site Address is https://bl1231.als.lbl.gov/

    The Plain Permalink style works, but whenever I switch it to anything else none of the links work and we are inundated with 404s.

    I did follow these instructions as best I could. In particular I copied the wordpress/index.php and wordpress/.htaccess into the DocumentRoot of the website.

    We have tried disabling ALL plugins, but the problem persists.

    Currently I have the pre-formated “Day and name” permalink style enabled and this appears to have created the following .htaccess file in my DocumentRoot:

    # BEGIN WordPress
    # The directives (lines) between "BEGIN WordPress" and "END WordPress" are
    # dynamically generated, and should only be modified via WordPress filters.
    # Any changes to the directives between these markers will be overwritten.
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress

    In some instructions I’ve been told to have this .htaccess file:

    <IfModule mod_rewrite.c>
    RewriteEngine Off
    RewriteCond %{HTTP_HOST} ^(www.)?bl1231.als.lbl.gov$
    RewriteCond %{REQUEST_URI} !^/wordpress/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /wordpress/$1
    RewriteCond %{HTTP_HOST} ^(www.)?bl1231.als.lbl.gov$
    RewriteRule ^(/)?$ wordpress/index.php [L] 
    </IfModule>

    But this also does not help with the permalink issue.

    Any advice or suggestions would be greatly appreciated.

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • RoseHosting

    (@rosehosting)

    You would want to check your <Directory> container in your virtual host file, as well as AllowOverride directive

    Thread Starter doodguy

    (@doodguy)

    # WORDPRESS
    <Directory "/path/to/my/webroot/wordpress">
        AllowOverride All
    </Directory>
    Moderator t-p

    (@t-p)

    The Plain Permalink style works, but whenever I switch it to anything else none of the links work and we are inundated with 404s

    If that works (i.e. plain), then try reading Using_Permalinks before setting a custom permalink structure again.

    Thread Starter doodguy

    (@doodguy)

    I did give that page a glance, and since we are serving via Apache I took extra special care to read the section about the .htaccess file(s). It seems that wordpress is able to modify the .htaccess file in the webroot directory, but changing the permalink style doesn’t seem to change the wordpress/.htaccess file.

    Thread Starter doodguy

    (@doodguy)

    OK. Problem solved.

    I finally determined that the .htaccess file in my web root directory was not even being used by Apache. This led me further up the config chain to http.conf where there was an AllowOverride None directive in the parent directory configuration.

    /var/www is set to AllowOverride None

    /var/www/html is set to AllowOverride None

    and I had this from my wordpress directory:

    /var/www/html/site1/wordpress set to AllowOverride All

    but this did NOT allow the .htaccess file in /var/www/html/site1/ to be read thus preventing the pretty Apache Rewrite Permalinks from working.

    I added a new Directory stanza for the main site1 document root:

    /var/www/html/site1 set to AllowOverride All

    Now things seem to be working as expected.

    I hope this helps some others out someday.

    Cheers.

    • This reply was modified 3 years ago by doodguy.
    Moderator t-p

    (@t-p)

    Glad you got it sorted ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Permalinks do not work’ is closed to new replies.