WordPress.org

Ready to get started?Download WordPress

Forums

cant get prettylinks working (10 posts)

  1. mbtbh
    Member
    Posted 3 years ago #

    Ubuntu fresh install

    After reading the sticky and other sites, this still is causing me problems.

    From what I gather i need to do 2 things to get this working.

    1. mod_rewrite
    2. .htaccess

    1. I have installed mod_rewrite http://blogs.spc.ox.ac.uk/info.php
    2. .htaccess is placed in /var/www (correct?) and looks like..

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    Option +FollowSymLinks
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPressRewriteEngine On

    What am I doing/not doing?

  2. mbtbh
    Member
    Posted 3 years ago #

    *wanting subdirectories

  3. Did you set up the network yet? It gives you code to put in the .htaccess file for the subfolder blogs. What you pasted isn't it.

    The .htaccess file should be in the same folder as your wp-config.php file.

  4. mbtbh
    Member
    Posted 3 years ago #

    I’ve amended the .htaccess with the following:

    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]
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
            Option +FollowSymLinks
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
  5. mbtbh
    Member
    Posted 3 years ago #

    i’ve tided up the replacation line, so there is no repeats.

    still no luck.

    i have installed network and now got the relevant contents (i believe?) in the .htaccess

    where next to look?

    thanks

  6. For subdirectories (including your follow symlinks call) you'd want this:

    Option +FollowSymLinks
    
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    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]
    </IfModule>
    # END WordPress

    Just to make sure :)

    Once you have that in, can you get to domain.com/subsite/wp-admin?

  7. mbtbh
    Member
    Posted 3 years ago #

    Thanks for that ipstenu. Unfortunately still no movement. http://blogs.spc.ox.ac.uk/matt/ still 404’ing.

  8. http://blogs.spc.ox.ac.uk/?p=8 works though...

    Can you turn on pretty permalinks on your MAIN blog? The problem may be that your .htaccess file isn't being read by your server, which you need to punt mod_rewrite into action for that. Ask your host if mod_rewrite is enabled for your account on your server.

  9. mbtbh
    Member
    Posted 3 years ago #

    I’d be the person to check to see if mod_rewrite does that, will have a look to see to make sure thats the case. Any clues where to look?

    I’ve turned it on and now it doesnt’t work, which would seem that .htaccess isn’t being read?

    Thanks again for your help so far :)

  10. AllowOverride FileInfo Options

    :)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.