WordPress.org

Ready to get started?Download WordPress

Forums

can't get to main blog page with %postname permalink on sub-directory install (31 posts)

  1. asafche
    Member
    Posted 3 years ago #

    i've installed the multisite with the sub-directory configuration.

    now, i created some pages as "about", and others on the main blog, with the permalink structure as "%postname%"

    the problem is that now, when i want to go to the about page on the main blog, the system "thinks" that i want to look for a sub-blug that call "about", and because it isn't existed, it sends me right a way to the home page.

    how do i know? because when i've changed the permalink to the normal structure (as "?page_id=2") it worked.

    some one knows how to make the pages work with the %postname% permalink, and to make the system to go to the page instead of looking for the blog with the page's name?

    thanks,
    asaf.

  2. I can actually reproduce this on a test install.....

    it's on a test install that I upgraded locally, so I want to confirm this with a fresh install.

    Cuz if it's doing this on the 3.1 RC, then we might have a release blocker.

  3. I cannot reproduce this on a test install that was an upgrade to 3.0.4 AND 3.1 RC2.

    However on WordPress 3.1-RC2

    Main site has pernmalinks of /%permalink%/ (so blog posts are domain.com/blog/postname)

    Added a page called 'foobar'. Worked fine.

    Mind you... I went and created a subsite called foobar, it DID NOT check for that name being taken as a page already... Which I had thought it was supposed to. o.O

  4. I was reminded that %postnams% isn't a good permalink to have anyway. Can you pick *any* other pretty permalink option? By default, multisite gives year/month/postname.

    Does that work for you?

    Also: did you REMOVE the /blog/ that is stuffed in the permalink in the main blog only? If so - that might be why.

  5. jmstovall
    Member
    Posted 3 years ago #

    I have a number of multisite installs running locally. Is there any particular scenario you're looking to have tested? It'll take me a couple hours, but if I can kick in some feedback, I will.

  6. See the OP. :)

    Put the permalink structure on %postname%, then makes some pages, then makes some blogs with the same name.

  7. jmstovall
    Member
    Posted 3 years ago #

    Yes, yes...OP, whatevs. :)

    Recreated the issue in a couple different ways on 3.0.4, same results.

    Hope that helps!

  8. ... Can you share DETAILS?

    What were your different ways?

  9. asafche
    Member
    Posted 3 years ago #

    Hi,

    I've tried changing the permalink to all proposed structures. only the default work for me. it was a fresh install of 3.0.4.

    what should i do?

    thanks,
    asaf.

  10. asafche
    Member
    Posted 3 years ago #

    so, Andrea_r, Ipstenu - do you have any ideas?

  11. If none of the permalink options work, AND your .htacess is correct (you can compare them to the samples ones here on the codex), then I would contact your host and tell them this:

    "It doesn't appear that my .htaccess is working correctly. Can you make sure that mod-rewrite is functioning correctly for my site?"

  12. asafche
    Member
    Posted 3 years ago #

    the host provider says that the mod_rewrite is o.k.

    he can say that and i really can't tell if it's his fault or not, but if this isn't a common issue then i supposed that this isn't a mod_rewrite thing...

  13. Generally we see this kind of error when the server isn't reading the .htaccess correctly, which is usually a server error. Do they have any sort of help for that?

  14. asafche
    Member
    Posted 3 years ago #

    as i said, the host is saying that everything is o.k.
    and i've doubled checked that my .htaccess is the same as in the codex.

    what else can i do?

  15. 1) Your .htaccess is wrong.
    2) Your host doesn't have their server set up to allow the .htaccess to be read

    Really that's kinda it :/

  16. link to your site?

  17. asafche
    Member
    Posted 3 years ago #

    o.k.
    this is my .htaccess:

    # BEGIN WordPress
    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]
    # END WordPress

    and my site is here.

    thanks.

  18. asafche
    Member
    Posted 3 years ago #

    is there some kind of check that i can do to find if the server is using the .htaccess and mod_rewrite properly?

  19. Ammaletu
    Member
    Posted 3 years ago #

    I'd like to add to this thread if I may. I tried my first MultiSite installation today, WP 3.0.4 on a XAMPP localhost (Windows) with both MySQL and PHP a current 5.x version. I used a sub-folder installation and created a second test blog. No plugins, unmodified TwentyTen theme. Everything works fine, except the permalinks for static pages in the default blog. From what I can see at the OP's website, it looks like it's the same problem.

    @asafche: mod_rewrite works at least partly, as you can see on pages like these: http://www.moob.me/blog/category/uncategorized/

    @andrea_r and everyone else: Regardless if .htaccess works or doesn't work -- shouldn't WP generate links for static pages as "/blog/hello-world" instead of "/hello-world"? Every other permalink on the default blog has the "/blog/" prefix, just not the static pages. My permalink structure by the way is "/year/month/title".

    Ok, there is one difference to asafche: In my case, I can see the static pages. They are displayed just fine, and when I try to create a new static page with the name of an existing blog, it gets a weird permalink with an appended "10" (e.g. "/techblog10"). So this might be two unrelated problems for the OP: WP generates the wrong permalinks (a bug?) and then the wrong permalinks don't work.

    Is there anything I can do to help clear this up? As my installation is on my local machine, I can try out pretty much anything that could help. :-)

  20. siteheroblog
    Member
    Posted 3 years ago #

    I've just FINALLY and I might say successfully installed a WP network and domain mapped two child sites with their own domain and my next tast was going to be setting up my permalinks to show "%postname%" just like the OP. I'm using version 3.0.4 so I guess I'd better just stick to the default for the time being as I've already had to resolve a ton of stuff today so I don't need anything else! EKk No. lol

    Andrea_r, I'd be interested to know why the "%postname%" isn't a good permalink to have?

  21. asafche
    Member
    Posted 3 years ago #

    so i don't understand...
    if my .htaccess is working in some of the URL's, as @Ammaletu mentioned, why i can't see only the pages in the menu?

  22. asafche
    Member
    Posted 3 years ago #

    look at this.
    it can't be an .htaccess issue, right?

    what can i do?
    is it a bug?

    please, help me.
    thanks.

  23. Ammaletu
    Member
    Posted 3 years ago #

    In some Trac ticket it was mentioned that it might be intentional that the static pages don't get the "/blog" prefix. If that is the case, the codex should mention this (I'd change the text but not if I'm not sure that this is actually correct).

    Now asafche, you could still have a .htaccess problem because at the moment you are not using the pretty permalinks. Calling the static pages with the ?page_id=123 link does not use the .htaccess, this goes straight to the index.php. Have you already created a second blog on the MultiSite install? You could see if the .htaccess works when you try to access any frontend page of the second blog. Those links would definitely need the .htaccess to work.

    To find the source of your problem, the usual approach would be to disable all plugins and switch to the TwentyTen theme. If it does work then (with pretty permalinks enabled), you know where to search for the problem. If it doesn't, it's usually an issue with the server except for the rare cases where it actually is a bug in the WP core. When you try this, check that the .htaccess does contain nothing else except the WP rules.

  24. @Ammaletu

    In some Trac ticket it was mentioned that it might be intentional that the static pages don't get the "/blog" prefix.

    It is intentional that pages don't get the /blog prefix. To which codex page are you referring?

    @asafche - Just becuase your .htaccess is correct doesn't mean your host has set up mod_rewrite in a way that the server can READ your .htaccess.

    That said. If I type in http://www.moob.me/klfjkasdhgfa I get redirected back to the http://www.moob.me/ page.

    That's NOT normal WP behavior. Betcha you have a plugin in conflict here.

  25. Ammaletu
    Member
    Posted 3 years ago #

    @Ipstenu: I mainly read http://codex.wordpress.org/Create_A_Network#Permalinks where the blog prefix is mentioned. I tried to clarify this in the text with a new paragraph. I hope the wording is ok, otherwise feel free to correct it. :-)

    I still think this is not good design. Really strange is that a new blog overrides existing static pages. No warning -- if you create a blog called "About", your static page "About" is simply not reachable anymore. This would not be the case if the static page lived under domain.com/blog/about.

    @asafche: Ipstenu has a point, normally just typing garbage in the URL should give you a 404 error code and the 404.php of the theme. Try to find out if it's a plugin's fault or the theme's.

  26. @Ammaletu: That rocked! I made on TINY change (the suffix a page gets when the name exists is always pagename-2 and then 3 and so on ;) ) but that was great. Thank you :) The codex is always a work in progress.

  27. Ammaletu
    Member
    Posted 3 years ago #

    @Ipstenu: Regarding the suffix: I know it's "2, 3..." for static page name conflicts. Strangely, when I tried to create a static page with the name of an existing blog, I got the "10" suffix. Don't know if that is really how it is supposed to work.

    And now back to asafche's problem. Sorry for partly hijacking your thread! :-)

  28. asafche
    Member
    Posted 3 years ago #

    it's o.k. Ammaletu, :)

    i still don't know what the problem is.
    i deactivate all the plugins and got back to 2010 theme, and i still can't get to the main site pages... :(

    how can i know for sure it's a problem with the host mod_rewrite or not? guys, i'm lost here...

    and by the way, thanks you all for trying.
    really, that worth a lot.

  29. asafche
    Member
    Posted 3 years ago #

    So - I've tested the mod_rewrite and it's working (with a simple text as describedhere.

    What else can i do?
    should i do a fresh install? can it help?

Topic Closed

This topic has been closed to new replies.

About this Topic