Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Resolved] Changing the URI causes dead links in activity stream.

  • @icepin

    Participant

    Hello,

    I needed to to change the website URL from mysite.com into http://www.mysite.com and now every old activity will lead to a dead link. If I press on an members, group link or anything else pointing inside the website it will open a new tab and redirect to http://www.mysite.com.

    Is there a way to have both working?

Viewing 2 replies - 1 through 2 (of 2 total)
  • @djpaul

    Keymaster

    You can probably set up a CNAME on your DNS to do this — best idea is to ask your host for assistance with this.

    Unfortunately BuddyPress’ activity stream is pretty much a “write once, never update” thing right now.

    @icepin

    Participant

    Tried, didn’t worked.
    If anyone will ever need this, the trick is done via .htaccess file.

    RewriteCond %{HTTP_HOST} !^www\..* [NC]
    RewriteRule ^ http://www.domain.com%{REQUEST_URI} [R=301,L]

    So, explained, if your blog/BP network has old links without www. and you recently changed the website URL to http://www.domain.com because you started using a CDN, this will help you to get you’re whole network back with no dead links. Tested on all sides, no errors.

    my .htaccess file looks like this:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

    RewriteCond %{HTTP_HOST} !^www\..* [NC]
    RewriteRule ^ http://www.domain.com%{REQUEST_URI} [R=301,L]

    RewriteRule ^index\.php$ – [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress

    Credits:
    http://www.456bereastreet.com/archive/200601/search_engines_and_canonical_urls/
    – the most awesome hosting company support for tweaking the code (KnownHost)

    Cheers! 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] Changing the URI causes dead links in activity stream.’ is closed to new replies.
Skip to toolbar