The MU forums have moved to WordPress.org

I need the right permalink for my .htaccess file (11 posts)

  1. krucke
    Member
    Posted 17 years ago #

    The page was actually setup by someone else, so I am trying to get the right permalink to match his .htaccess file which is:

    RewriteEngine On
    RewriteBase /

    # Rewrite http://www.domain.com to domain.com
    RewriteCond %{HTTP_HOST} ^www\.(.*)
    RewriteRule ^(.*) http://%1/$1 [R,L]

    #uploaded files
    RewriteRule ^(.*)?/?files/(.*) wp-content/blogs.php?file=$2 [L]

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule . - [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-.*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    #RewriteCond %{REQUEST_URI} !/(assets|dav|ical|_ical)
    RewriteRule . index.php [L]

    ErrorDocument 404 /index.html
    ErrorDocument 401 /index.html
    ErrorDocument 403 /index.html

    I have tried a couple of different tags, but the only one that seems to partially work is the default permalink, but it stills returns a blank page to the others that are hosting from my site. I liked to have a pretty permalink with the name of the page, blog, or site as the extension not a page id.

  2. drmike
    Member
    Posted 17 years ago #

    Actually the permalinks are done internally and on a blog by blog basis with WordPress Multiuser and not in the htaccess file. Dashboard -> Options -> Permalink -> Choose which permalink setup you want.

    I liked to have a pretty permalink with the name of the page, blog, or site as the extension not a page id.

    I would have put that at the top of your post by the way. Kind of a pain to have to read through the entire post just to see what specifically you're trying to do.

    Hope this helps,
    -drmike

  3. krucke
    Member
    Posted 17 years ago #

    I tried changing the permalink and the pages are then blank besides the main page. Even tried making an htaccess file with the updated code. It seems like I still need an htaccess file.

  4. peiqinglong
    Member
    Posted 17 years ago #

    Have you tried starting over? Make a backup of the current .htaccess and make a new blank .htaccess file and then go to Options > Permalink.

  5. drmike
    Member
    Posted 17 years ago #

    Wouldn't matter since the htaccess file remains the same on all wordpress multiuser installs. As noted the permalinks are held within the database.

    The only thing that changes is the second line which is the base declair as to what directory the wpmu files are installed into.

    I do note that you're missing a line though. This is what it's supposed to look like:

    RewriteEngine On
    RewriteBase /
    
    #uploaded files
    RewriteRule ^(.*/)?files/$ index.php [L]
    RewriteRule ^(.*/)?files/(.*) wp-content/blogs.php?file=$2 [L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule . - [L]
    RewriteRule  ^([_0-9a-zA-Z-]+/)?(wp-.*) $2 [L]
    RewriteRule  ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]

    As to the blank pages, without seeing what is occuring, what the URLs look like, and your checking of the error logs, there's not a whole lot we can help with here. Two things do come to mind though. 1) Your browser is looking at a cache of the first page with the old links. or 2) WPMu's internal cache isn't clearing. Although with #2, you have to turn that on yourself via a setting within the wp-config.php file which most folks I don't believe are doing.

    Anything in the error logs?

    How about a link so we can see what is occuring please with these blank pages?

  6. drmike
    Member
    Posted 17 years ago #

    I'm also wondering how oud your install is since it still contains the 'www' bit in there. That was removed a long while back. Please leave it in your htacess file as it's needed if you do have an older install.

  7. krucke
    Member
    Posted 17 years ago #

    The install was about a year ago with wordpressmu 1.2.1 The site was set up by a person that was previously in my position. The main site is http://hhscobras.pasco.k12.fl.us which is operating fine but the links at the top of the page are only working if the permalink is set to default. The teacher pages have remained blank throughout. I tried to switch the htaccess code with the on above and still the same problem. Also a teacher site for an example is http://hhscobras.pasco.k12.fl.us/band. All the data still remains in the database, but is there something I might need to change in the database. Thanks for all your help drmike.

  8. lunabyte
    Member
    Posted 17 years ago #

    If it was with 1.2.1, then it was a couple months ago, not a year. It wasn't even "1.0" a year ago.

  9. drmike
    Member
    Posted 17 years ago #

    Can you check to see if the webserver has mod_rewrite activated? The links being generated are fine but those are within the database as well.

    edit: Hmm, just over a year:

    http://trac.mu.wordpress.org/changeset/680

  10. krucke
    Member
    Posted 17 years ago #

    Where would I check to see if mod_rewrite is activated?

  11. lunabyte
    Member
    Posted 17 years ago #

    Oh, apache's config file, phpinfo, etc.

    @Doc, I was referring to a final. RC's don't count.

About this Topic