htacess for root folder with wordpress install and subdirectory for another domain - wordpress

I have a wordpress install in my website directory e.g.( public_html/wp-content, public_html/wp-admin, public_html/wp-includes) and I have a subdirectory to which points to another domain public_html/anotherdomain.com
I don't want the another domain messing up the root wordpress install.
ex. anotherdomain.com should only go to public_html/anotherdomain.com and originialdomain.com should access public_html folder excluding the anotherdomain.com.
My question is what is the best approach for this?
using htaccess?
using the cpanel addon domain and make a subdirectory for the wordpress install?

If you use .htaccess you can block access to anotherdomain.com from your wordpress site. This will work but is kind of a sloppy hack and doesn't plan for the future pretty well. Are you going to keep doing this when you get more domains and install them.
The cleaner way to do it is what I think you are saying in your number 2. Give the wordpress site it's own directory that is a peer with anotherdomain.com. This way it will work the same if you have 1, 2, or 10 domains.

Related

create a htaccess rewrite rule from subdomain to subfolder

There was some discussion on this topic which i have read through, but it does not help my current situation.
Problem.
I have a wordpress mu site located on a subdomain (site.website.com)
The first subsite i created is (site.website.com/subsite1)
I want to serve (site.website.com/subsite1) from (website.com/subsite1)
I know this is possible because i already do it in a different way. I have a wp mu located in a subdolder.(site.website.com/mainsite) and have created subsites at (site.website.com/subsite1) (site.website.com/subsite2) (site.website.com/subsite3)
I did this by manaually editing the site url in wordpress admin, then creating a folder in the home directory, with the same name as the subsite and placing a htaccess file with rewrite rules in it.
Now i want to achieve the same thing with a multisite install in a subdomain, pointing to a folder in the apex domain with a htaccess file in it.
The problem is that im lacking in knowlege when it comes to rewrite rules. Any experts please step up.

WordPress multi-site in a subfolder on host

I'm wondering about a WordPress multi-site installation and nothing I've come across has clearly laid this out for me. I'm hoping to get a little more clarification on what exactly will happen in my WordPress/Server instance if I set up a multi-site.
I've currently got my actual site as a single instance Wordpress install at the root of my domain. I'd like to keep it that way.
I've set up a sub-folder on my site called "client-login" and it has it's own WordPress install. The idea is to make this WordPress instance a multi-site one. With the intent being that I can have multiple sites in there and give access to them as needed.
So far it all is making sense but when I go to actually complete the multi-site install it says the server address will be my domain at root level. It doesn't say domain/client-login.
My question is if I turn on the multisite will it take over the root of my domain and include my "real" site as part of it?
lets consider,
you have a main wordpress domain at public_html/
you have created a subfolder in host like public_html/client-login for another wordpress instance
these two will behave as a separate sites.
The wordpress multisite will work inside the public_html/mainsite not outside of it, and it wont affect the client-login subfolder.

Moving wordpress site from subdomain to domain with 1 caveat

I already have wordpress installed in my root, but I haven't built anything on it.
All these while I have been building on my subdomain, which is also using wordpress.
Now I have come to the conclusion to move everything I have from the subdomain to the root.
Are there anything I should take note of? Should I remove the wordpress installation that is in my root?
I'm using cpanel # hostgator
Remove the wordpress installation that is in your root directory, then copy all the files from the sub-domain's folder to your root directory. You should note that before moving the files, log into the existing Wordpress dashboard and under Settings -> General you need to change the URLs of your site first, otherwise you won't be able to log in once your site is moved. That's it.

How to jail Wordpress directory inside Magento directory?

Goal: We have a Magento installation which contains a lot of sensitive data. We're looking to host a Wordpress installation.
Problem: Since we're installing third-party modules on Wordpress, we don't want any security issues in Wordpress to be able to compromise Magento.
I've spoken to a couple of my friends, and also had a think back to how it's been implemented in the past, but I wanted another opinion.
Since the wordpress directory will reside inside of the magento directory, would it be sufficient to chown the files inside of wordpress to a new user ("user-wp"), and then to chroot the user-wp user to the wordpress directory? Magento would then still have access to all of the Wordpress files, but not vice-versa.
Any other suggestions on how to go about implementing this would be more than appreciated! Somebody also suggested configuring a separate vhost.
Using a subdomain like blog.site.com would probably be the easiest way to set this up. All you would have to do is add a new VHost for the WordPress installation.
I don't think Chrooting would provide much security. You may also run into WordPress Plugin issues with such a configuration.
The setup is tricky. You would have to go and modify the PHP-fpm process pool and users it runs with. Then assign one pool to Magento and another to WordPress. Additionally you will also want to serve static assets & uploads from the Webserver itself.
And when you change this config you have to retest your Magento install to make sure things you didn't break anything accidentally.
Too much hassle, just use the subdomain. :)

Wordpress and Drupal on the same domain cause htaccess conflicts?

Have a client who wants to move their Wordpress.com blog over to their main domain that has a Drupal installation. If I add Wordpress to a "/blog/" directory on the server, will there be any conflicts with the htaccess ie Mod Rewrites etc?
Thanks.
If you place the WordPress files within the /blog/ directory then no, there certainly shouldn't be any htaccess conflicts.
Update :
What berkes suggests below (ie putting WordPress and Drupal in their own separate folders side by side) would be an ideal solution if you were starting from scratch.
However, it would change the URLs of all existing content, which you probably don't want.
One thing you could do is install them side by side and then use mod-rewrite to make example.com/blog go to the wordpress directory and anything else go to the drupal directory.
This way all existing content would stay at the existing URLs even though the drupal instalation had moved.
Note that even this solution would prevent anything which Drupal tried using the /blog path for from being visible, instead redirecting to WordPress.
It will be impossible to install Drupal and Worpress in one directory. Not only because of .htaccess issues, but also because of (potentially) conflicting files and libraries. Moreover: your maintainance and upgrades will be come hell.
I would advice to use different virtual hosts. Any more professional webhoster allows you to define virtualhosts. Defining them depends on the server, setup, lfavour of OS and so forth, and is a whole topic on its own.
Alternatively, you could create a /path/to/webroot/__cms__/ and /path/to/webroot/__blog__/directory. Advice you to not put Wordpress under drupal (a /blog directory in the Drupal directory) nor to put Drupal under wordpress (a /cms directory inside your WP install. This will lead to conflicts. Drupal may have an url /blog (it does!) that will conflict and wordpress may have a /cms url (it doesn't, but could have) that will conflict. Side by side, not inside one another.
Another alternative would be to bridge one CMS with the other. This is tough and complex, but it would be possible to include wordpress in Drupal or vice-versa, given you have enough development and configuration time and -experience.

Resources