• Resolved kenrik

    (@kenrik)


    My site was working perfect with custom permalinks. Now after upgrading to 3.1 I get a 404 error using custom permalinks.

    Normal ugly permalinks work but the custom ones are broken ??

    here is my .htaccess please let me know how to fix this.

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # uploaded files
    RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule . index.php [L]
    
    # deny access to wp-config.php
    <files wp-config.php>
    order allow,deny
    deny from all
    </files>
    
    # deny access to readme.html
    <files readme.html>
    order allow,deny
    deny from all
    </files>
    
    # deny access to .htaccess
    <files .htaccess>
    order allow,deny
    deny from all
    </files>
    
    # prevent folder browsing
    Options All -Indexes
    
    # prevent comment posting to requests with no referer
    RewriteEngine On
    RewriteCond %{REQUEST_METHOD} POST
    RewriteCond %{REQUEST_URI} .wp-comments-post\.php*
    RewriteCond %{HTTP_REFERER} !.*example.com.* [OR]
    RewriteCond %{HTTP_USER_AGENT} ^$
    RewriteRule (.*) ^https://%{REMOTE_ADDR}/$ [R=301,L]
    
    # limit size of request body
    LimitRequestBody 10240000
Viewing 10 replies - 46 through 55 (of 55 total)
  • So…what is the ultimate solution to this Permalink issue? I’m just starting with MultiSite and have Site 1 and Site 2 functioning and mapping perfectly.

    I am using the WordPress MU Domain Mapping Plugin–but have no other Plugins Active, other than Jetpack.

    I am seeing the Custom Permalink problem that has been mentioned–404 Error–while default Permalinks work fine. I’d prefer not to use Luke’s hotfix, if another is available.
    Thanks.
    Jason

    @jasonmcartor:

    Since my earlier post, that hotfix is now a plugin. On the following page, several alternatives are listed that you can try before resorting to the plugin.

    https://wpcodesnippets.info/blog/wcs-custom-permalinks-hotfix.html

    But, if you have no other plugins installed … your .htaccess file is correct … and you still have the pblm with the 2010 theme … you will probably need the plugin.

    Well over 1000 sites are using either the plugin or the prototype function. It’s coded to work with the internal URI structure … so it should work in perpetuity.

    Nonetheless, I, too, hope you don’t have to resort to the plugin.

    @luke

    Thanks for the follow-up. I may have to give your plugin a go. I’m new to the MultiSite, so do I install it in the SuperAdmin and activate it across the Network?

    Also, with regard to the .htaccess edits (I haven’t touched any of that yet), am I looking at the SuperAdmin .htaccess file, right at the root of my master WP Install?

    (I am running TwentyTen on both “test” Sites.)

    @jason:

    You may want to install the plugin on a single site first to make sure it takes care of the bug for you. When you’re satisfied, do this for full network activation:

    Visit your Dashboard. Click Network Admin at the top right. Click Plugins in the sidebar menu. Locate WCS Custom Permalinks Hotfix in the list. Then, click Network Activate.

    Yes … that’s the correct .htaccess file. Generally, you won’t have this file inside other folders.

    And … welcome … to MultiSite … with this feature enabled … and the domain mapping plugin, you have greatly expanded the possibilities for your installation. I started using MU when it was a prototype as a separate branch.

    Also, here’s a cool aspect of multi-site (with the domain-mapping plugin) that isn’t actually documented, but it makes sense after you think about it.

    If you create a sub-directory inside your “public_html” folder (or whatever it’s named in your installation) outside of WP, each of your WP site’s have access to it.

    For example:
    https://mysite1.com/my-shared-folder/somefile.html
    is the same as
    https://mysite2.com/my-shared-folder/somefile.html
    and
    https://mysite3.com/my-shared-folder/somefile.html
    and so on…

    You might find a use for this trick at some point.

    @luke

    Guys like you are what make using WordPress so much fun and I appreciate your responses. Thanks for all the help and the warm welcome. The MultiSite potential really has me excited.

    I just looked at my .htaccess file and all it has is:

    AddHandler php5-script .php

    # BEGIN WordPress

    # END WordPress

    You’re suggesting to replace the above code with:

    # BEGIN WordPress MultiSite
    <IfModule mod_rewrite.c>

    RewriteEngine On
    RewriteBase /

    #uploaded files
    RewriteRule ^(.*/)?files/$ index.php [L]
    RewriteCond %{REQUEST_URI} !.*wp-content/plugins.*
    RewriteRule ^(.*/)?files/(.*) wp-includes/ms-files.php?file=$2 [L]

    # add a trailing slash to /wp-admin
    RewriteCond %{REQUEST_URI} ^.*/wp-admin$
    RewriteRule ^(.+)$ $1/ [R=301,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]

    </IfModule>
    # END WordPress MultiSite

    …I’m reading you correctly, right?

    Thanks.

    First, it looks like your server is using PHP4 by default. That’s very odd these days, but not an issue, per se. But, it may be indicative of other out-of-date implementations.

    Before you change anything, you should backup your .htaccess file locally … just in case there are issues.

    And … yes … replace:
    # BEGIN WordPress

    # END WordPress

    with the stated code. It’s also peculiar that there’s no code at all in that segment. If your site stops working after inserting this code, just restore your backup and try the plugin.

    @luke

    Well, the .htaccess edit fixed it. I looked at my Hosting Admin and I am running PHP5 on that site, and the majority of the sites I host.

    Did you just look at Media Temple’s site documents to see the PHP4 thing, or do you have another way of detecting PHP versions?

    Thanks again. Have a great weekend!

    Cool. Drop by my site sometime … lots of cool articles for developers.

    AddHandler php5-script.php

    indicates that 5.x is not native.

    Put a # at the start of that line (to make it a comment) and see if the site still works okay. If so, it’s not needed for your WP installation.

    I’ve not used that host, but I’ve heard that you really need to watch your bandwidth and other resources so as to not surpass your allotment and be charged extra.

    I was having the same problem with 3.1.

    I was using /%category%/%postname%/ structure for permalinks and suddenly they stopped working after upgrade.

    I found a quick fix though.

    Put category in Category Base and tag in Tag Base fields in Permalinks Settings page.

    It worked for me.

    Cheers!

Viewing 10 replies - 46 through 55 (of 55 total)
  • The topic ‘WordPress 3.1 Broke Permalinks’ is closed to new replies.