WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Enabled Multisite now Custom Post Type returns 404 (6 posts)

  1. ZeroGravity
    Member
    Posted 1 year ago #

    I enabled multisite on an existing WordPress install (3.5.1 with genesis 1.9.1). Links to custom post type posts were working before I enabled MulitSite. Everything with the MultiSite is working fine except a pre-existing custom post type is returning 404 errors. If I set 'rewrite' => false the posts load. But putting back the slug it doesn't.

    I have tried switching 'with_front' between true and false and every other post I have stumbled across when searching for a solution and nothing seems to work.

    I went to the permalinks page in the admin and saved before testing each change.

    The url that is being returned by get_permalink() is.
    http://www.my-domain.com/blog/post-type/postname.

    Thanks!

  2. What's in your .htaccess?

  3. ZeroGravity
    Member
    Posted 1 year ago #

    Ere Tis

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    
    # redirect non www to www - http
    RewriteCond %{HTTP_HOST} ^mymissiontrip\.com [NC]
    RewriteRule ^(.*)$ http://www.mymissiontrip.com/$1 [R=301,L]
    
    ##
    # Redirect addon domains
    ##
    RewriteCond %{HTTP_HOST} ^mymissionstrip\.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www\.mymissionstrip\.com$
    RewriteRule ^(.*)$ "http\:\/\/www\.mymissiontrip\.com/$1" [R=301,L]
    
    RewriteCond %{HTTP_HOST} ^mymissionstrip\.net$ [OR]
    RewriteCond %{HTTP_HOST} ^www\.mymissionstrip\.net$
    RewriteRule ^(.*)$ "http\:\/\/www\.mymissiontrip\.com/$1" [R=301,L]
    
    RewriteCond %{HTTP_HOST} ^mymissionstrip\.org$ [OR]
    RewriteCond %{HTTP_HOST} ^www\.mymissionstrip\.org$
    RewriteRule ^(.*)$ "http\:\/\/www\.mymissiontrip\.com/$1" [R=301,L]
    
    RewriteCond %{HTTP_HOST} ^mymissiontrip\.net$ [OR]
    RewriteCond %{HTTP_HOST} ^www\.mymissiontrip\.net$
    RewriteRule ^(.*)$ "http\:\/\/www\.mymissiontrip\.com/$1" [R=301,L]
    </IfModule>
    
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [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
  4. Okay pull out EVERYTHING except the WordPress rules for a test.

  5. ZeroGravity
    Member
    Posted 1 year ago #

    Thanks for your help! I removed everything before "# BEGIN WordPress" and I still get 404s.

  6. ZeroGravity
    Member
    Posted 1 year ago #

    I found the solution. I added flush_rewrite_rules( false ); to the end of the function where I register the custom post type. No more 404s. :) Giving credit where credit is due, thanks to Michelle http://wpquestions.com/question/show/id/802.

    Thanks for looking into things for me @Ipstenu.

Topic Closed

This topic has been closed to new replies.

About this Topic