Rewrite subdirectory to subdomain using .htaccess and not using Multisite

Hello Guys!

Well, I´m creating a buddypress network using some subdirectories.

I create a new folder, install wp and install bp... I need it to be like this, as I´ve already tried to set up it as a buddypress multi network using SBrajesh plugin from BuddyDev. The plugin works very well, but a lot of plugins I need to use does not work in this set up.

So, I´m going to work with subdirectories to run this project.

The problem is that I need the sub installations to run as subdomains, I´ve already got this to work with this .htaccess code:

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^colabnet.com.br [NC]
RewriteRule ^(.*)$ http://www.colabnet.com.br$1 [L,R=301]

RedirectMatch 301 ^/testandohtaccess/(.*)$ http://testandohtaccess.colabnet.com.br/$1

You can try to access: http://testandohtaccess.colabnet.com.br
It worked very well, but... when I try to manage wp-admin it does not work anymore, when I type: http://testandohtaccess.colabnet.com.br/wp-admin I´m redirected to:

http://www.colabnet.com.brwp-login.php/?redirect_to=http%253A%252F%252Ftestandohtaccess.colabnet.com.br%252Fwp-admin%252F&reauth=1

How can I make the wp-admin to work?

Thanks Guys!

Derek

  • Paul Barthmaier

    Hi there,

    Are your Site URL and Home URL the same? Setting up the www as the base URL is problematic. It's better if you have the naked domain = to www via cName in your cPanel. This way they are thought of as the same thing and when Wordpress grabs the base URL, say for getting to your wp-admin, it will take the correct one, ie the naked domain. You will then need to adjust your htaccess, but it should work out.

    Hope this helps! Let us know how it goes.

    Cheers,
    Paul

    Don't like native styling of Comments Plus? No prob: http://marker.to/YQ7EuI

  • aecnu

    Greetings Derek,

    We have not heard back from you as to the status of this issue.

    If you are still having an issue please let us know so that we may try to get you fixed up as soon as possible by choosing to check mark this ticket as unresolved below and posting any new errors or symptoms you are noticing.

    This action will also bring your ticket up front back in plain view again within the ticket system.

    Thank you for being a WPMU DEV Community Member!

    Cheers, Joe

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.