Skip to:
Content
Pages
Categories
Search
Top
Bottom

Permalinks setup with WP intalled in subdirectory and index.php in root

  • Avatar of gian-ava
    gian-ava
    Participant

    @gian-ava

    am running WP 2.9.2 / BP 1.2.2.1 and I got WP installed in a subdirectory (with index.php and .htaccess in the root).

    Everything works as it should, except for this problem, which is probably due to the installation setup being in a subfolder, since other are experiencing problems with the same a setup.

    I’d like to sort a few things out with such a setup, since I believe many are those who got WP in a subdirectory.

    First, with WP installed in a subfolder you got this settings, right?:

    • Site URL: http://mysite.com/folder

    • BLog URL: http://mysite.com/folder

    The results is that you have a permalin structure such as:

    • http://mysite.com/page

    • http://mysite.com/post

    • and so on…

    The problem is that whenever you navigate within the web pages generated by BP (you are in a BP component), you get this:

    • http://mysite.com/folder/activity

    • http://mysite.com/folder/members

    • and so on…

    Is there a way to have the same permalink structure as in WP pages?

    Optionally, and ideally, would it be possible to have everything within BP to display with a base name? Like if you are running a regular site and want to create/enable a section of the site (not the whole site) for social network (BP components), that everything displays for example as:

    • http://mysite.com/socialnetwork/activity

    Thanks for helping. I am sure this is a piece of information useful to many.

Viewing 20 replies - 26 through 45 (of 45 total)
  • Avatar of r-a-y
    r-a-y
    Moderator

    @r-a-y

    Kind of hard to debug without seeing your site and theme code.

    Did your homepage link previously direct to mysite.com?

    Also, before adding the above code snippet, what happened when you went directly to mysite.com/wordpress?

    Avatar of sueme
    sueme
    Participant

    @sueme

    The Homepage link previously went direct to mysite.com and all my pages or blogs were at mysite.com/pagename.

    Now all the new BuddyPress pages go to mysite/wordpress/buddypresspage That’s OK

    All my previous pages and blogs still go to mysite/pagename That’s OK

    The only problem is my ‘Homepage’ which was showing my most recent blogs but now shows mysite/wordpress

    To be honest, I don’t know what would have happened if I’d gone to mysite/wordpress before, because nothing ever went to it!

    Just worked out that if I change ‘Settings – Reading’ to ‘Static Page’ instead of ‘Latest Posts’ then the ‘Home’ Link will go to it, so will use that as a work around for now. Would still like to get my home page back to ‘Latest Posts’ though.

    Avatar of r-a-y
    r-a-y
    Moderator

    @r-a-y

    With the above code snippet, your BP pages should actually go to mysite.com/BPpage.

    If you did not use the code snippet above, your BP pages would reside at mysite.com/wordpress/BPpage.

    So if BP wasn’t running correctly before the snippet, there’s something larger going on.

    I think you should double-check these instructions again:

    http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory

    Avatar of sueme
    sueme
    Participant

    @sueme

    I have checked the above instructions. I’m using the above code and my site is sorted except for the ‘Home’ Page.

    All my links, BuddyPress and the pre-existing WordPress links all open on the correct page except the ‘Home Page.

    I’m using BuddyPress default theme and when I activated it. it created a ‘Home’ tag that goes straight to the Mysite/WordPress folder and lists its content.

    I’ve created a static ‘Home’ page, and this to has created a ‘Home’ tag in the header that does actually go to the home page.

    So, currently, I’ve got two ‘Home’ links in my header, an incorrect one taking me to a folder list, and a correct one taking me to my home page.

    Is there a way of getting rid of the default home page, just leaving me with the new one I’ve created?

    Avatar of sueme
    sueme
    Participant

    @sueme

    When I go direct to mysite.com it goes to my correct homepage and the default homepage tag is highlighted, but if I actually click on that tag it takes me to the mysite/wordpress folder list. weird!

    Avatar of sueme
    sueme
    Participant

    @sueme

    All I need now is for the ‘Home’ link in the header to point to mysite.com it currently points to mysite/wordpress

    Anyone know how I change this?

    The bp theme header shows

    <div id="header">

    <h1 id="logo"><a>" title="<?php _e( 'Home', 'buddypress' ) ?>"><?php bp_site_name() ?></a></h1>

    <ul id="nav">
    <li<?php if ( bp_is_front_page() ) : ?> class="selected"<?php endif; ?>>
    <a>" title="<?php _e( 'Home', 'buddypress' ) ?>"><?php _e( 'Home', 'buddypress' ) ?></a>

    So presumably (says she with little knowledge) I need to change this to something else?

    Avatar of r-a-y
    r-a-y
    Moderator

    @r-a-y

    Create a child theme of the BP default theme and make your changes there.

    Here’s a guide:

    http://codex.buddypress.org/how-to-guides/building-a-buddypress-child-theme/

    Avatar of sueme
    sueme
    Participant

    @sueme

    Sorted. Thank you r-a-y for pointing me in the right direction.

    I created a child theme, copied the header files into it. Changed the above two lines so they pointed to mysite.com instead of mysite.com/wordpress that they were originally pointing to.

    Thank you once again.

    I’m really pleased with your help, and with the result.

    Sue

    Avatar of Tmort
    Tmort
    Participant

    @tmort

    @r-a-y I need a little bit of help with this. My site is officialmancard.com and I’ve got wordpress running in a folder (officialmancard.com/omc/). Same issue as everyone else, all of my BP related links (My Profile, activity stream, etc) all have the /omc/ folder.

    I’ve put your code into a bp-custom.php as well as my child themes function.php but I’ve had no luck. Can you offer any suggestions?

    Avatar of r-a-y
    r-a-y
    Moderator

    @r-a-y

    Only add it in one location. gian-ava has it in his /wp-content/plugins/bp-custom.php (note the path), so remove the snippet from your functions.php.

    Avatar of r-a-y
    r-a-y
    Moderator

    @r-a-y

    @tmort – post the contents of your bp-custom.php file, preferably @ pastebin.com.

    Avatar of Tmort
    Tmort
    Participant

    @tmort

    Its small, but I posted it in the pastbin anyway.

    http://pastebin.com/sUTTdXik

    Stupid question to ask now, I know, but do I have to activate bp-custom.php like a regular plugin?

    Ray thanks so much for the help, you really have no idea how much sleep I’ve lost over this!

    Avatar of Tmort
    Tmort
    Participant

    @tmort

    @r-a-y got it! It worked! Not sure if my browser was cached or something else went loopy but everything worked! Thanks so much man!

    Avatar of r-a-y
    r-a-y
    Moderator

    @r-a-y

    No problem, Tmort.
    Sometimes all that’s needed is a hard refresh!

    And no, you don’t have to activate bp-custom.php ;)

    @r-a-y

    I tried you code in my bp-custom.php file, but it is not working. please take a look, http://www.imbaalumni.com, and let me know if you have any suggestions. Here is the code of the bp-custom.php, http://pastebin.com/M0NPB2Dk

    Also, check out the “log In” link in the admin bar at the top of the page, how would I change that link?

    @gian-ava – did you post in Trac?

    Thanks,

    Kalman

    Avatar of r-a-y
    r-a-y
    Moderator

    @r-a-y

    @ffemtkl – what version of BP are you using? I think BP 1.2.4 might have fixed the issue.

    The code looks like it’s working for the member profiles, but not the site activity page.

    @r-a-y I am using the most current version of BP, 1.2.4.1.

    I had to remove your code from my bp-custom.php because every time I tried to install a new plugin I got an error saying the header had already been called by bp-custom.php, error on line…

    Thanks,

    Kalman

    Avatar of r-a-y
    r-a-y
    Moderator

    @r-a-y

    @ffemtkl – that’s because you probably have some whitespace at the end of the PHP closing tag. Delete anything after ?> and see if that fixes your problem.

    @r-a-y – Thanks for the tip. I do not get the error message anymore. You plugin seems to work except for one place, the header. There are still 3 links that still link to the subdirectory. I guess I am just going to go with a child theme (does not look to hard to setup) to fix that issue. Hopefully with WP 3.0 and the new BP coming out, this issue will be corrected.

    Avatar of Stigmartyr
    Stigmartyr
    Member

    @stigmartyr

    @r-a-y – hey man thanks for being a great help here to the community. I’ve been reading most of your posts in the forums over the past several hours fighting with my permalinks in activity streams.

    I saw your .htaccess redirect post for mismatch 301 and tried it but I think I need it customized for activity streams?

    In my example, certain activity posts are just going to the front page of my site rather than the post itself, they’re all coded like: http://www.site.com/activity/p/0001 when you click ‘view’ it just goes to the home page :(

    Pulling my hair out trying to figure out how to get them to refresh or something. My permalink structure is /%post_id%/%postname%

    It’s making me crazy lol

Viewing 20 replies - 26 through 45 (of 45 total)

You must be logged in to reply to this topic.