WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Fresh network install - permalinks broken (7 posts)

  1. tribalcomm
    Member
    Posted 3 years ago #

    I just setup a new LAMP server in our company to get about 30 blogs hosted internally instead of various places. I have experience with WordPress, but not with MU (or network now...) and I am having an issue.

    We got the site installed using subdirectories, and I am going to map root-level domains to each blog once we start migrating. For now though, we are getting our primary company blog setup.

    It is the root blog, so the path is /. When I turn on permalinks, all the links though say /blog/... I do not ming that, but the links do not work. I get a page cannot be displayed error.

    htaccess is:

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # uploaded files
    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]
    
    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule  ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
    RewriteRule  ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]

    If I turn on the regular ?p=123, everything works, but no pretty permalinks work.

    Any ideas?

    Thanks!

  2. Is mod_rewrite enabled? :)

    If so, is Apache set up to allow htaccess files to be read?

  3. When I turn on permalinks, all the links though say /blog/...

    FYI, this is by design. WordPress drops in /blog/ to preface your blog posts. This will be changeable one day in the future.

  4. rhibbert
    Member
    Posted 3 years ago #

    Previous post disappeared into the ether..

    My problem was that Apache was not rewriting the URL. I had to add the following to the httpd.conf file
    (It can also be added to the .htaccess file if I remember correctly)

    <Directory "/var/www/wordpress">
    RewriteEngine on
    RewriteCond %{HTTP_HOST} !^www\.example\.org\.uk [NC]
    RewriteCond %{HTTP_HOST} !^$ [NC]
    RewriteRule ^(.*)$ http://www.example\.org\.uk/$1 [R=permanent,L]
    Options FollowSymLinks MultiViews Indexes
    AllowOverride FileInfo
    Order allow,deny
    Allow from all
    </Directory>

  5. Cleaned up the DP :) Sometimes you have to hit hard-refresh to show up. There's a lot of traffic here and sometimes caching goes weird.

  6. rhibbert
    Member
    Posted 3 years ago #

    Thanks.

    Looking at my post, the three lines

    RewriteCond %{HTTP_HOST} !^www\.example\.org\.uk [NC]
    RewriteCond %{HTTP_HOST} !^$ [NC]
    RewriteRule ^(.*)$ http://www.example\.org\.uk/$1 [R=permanent,L]

    are optional - they simply make sure that example.org.uk is redirected to http://www.example.org.uk

  7. tribalcomm
    Member
    Posted 3 years ago #

    If so, is Apache set up to allow htaccess files to be read?

    Thanks Andrea_r, that was it.

Topic Closed

This topic has been closed to new replies.

About this Topic