Second domain problems

I've read through several related threads on the forum but I cannot figure out what I am doing wrong. I'm a novice at this stuff. Help?!?!

Here's background:
Prior to adding a seconddomain.com I had onedomain.com. I had loaded wordpress to /var/www/html/wordpress/. I added an .htaccess file to /var/www/html with the following: redirect 301 /index.html http://www.twowheeltales.com/wordpress/ so that when someone browses to onedomain.com, they are automatically redirected to onedomain.com/wordpress/ Anyway, onedomain.com working fine.

Here's current Issue:
Now, I have added a seconddomain.com to the account using the site manager and the DNS is actively pointing to westhost (for a few weeks). I've used the site manager to give a new directory for seconddomain.com /var/www/html/wordpress2. I uploaded wordpress a second time (completely separate install from the first install) to /var/www/html/wordpress2/ When I type seconddomain.com in a browser, I go to onedomain.com/wordpress/ but that's NOT what I want--I want to go to onedomain.com/wordpress2/ I tried deleting the .htaccess file, but that did not help (and messed up things when you type in onedomain.com).

.htaccess files are recursive. This means your redirect applies to all folders within /var/www/html/. Since you put the folder for seconddomain.com inside of /var/www/html, this means the .htaccess file applies to both domains.

The solution is to put each domian in a seperate directory. Never put one domain's directory within another's. Don't make the folder for seconddomain.com a subdirectory of /var/www/html. Instead, make a new folder like /var/www/seconddomain.com and put the pages there instead.

Note: You'll also need to make sure that in the /etc/httpd/conf/httpd.conf file, within the <Directory /> section, that the line beginning with "AllowOverrides" reads "AllowOverrides All" if it does not. Contact WestHost technical support (links below) if you need assistance checking this setting or making this change.

This worked for me, too! Rather than just do it for all (which per the comments is not secure), I copied the <Directory /var/www/html> settings and made a second entry that pointed to the new 2nd domain's directory.

If what you are trying to do is have requests for http://seconddomain.com load the Wordpress blog located in /var/www/html/wordpress/, that can be easily accomplished.

All you would need to do is in the Site Manager set the secondary domain directory to /var/www/html/wordpress/. After making this change you would also need to edit the database in 2 places. Bring up phpMyAdmin by going to http://primarydomain.com/pma (it would first need to be installed through the Site Manager), and then click on the wordpress database in question. Then click the wp-options table and click the browse tab. Once here, click the edit icon next to row 1, siteurl to http://seconddomain.com and click Go to save it. Now go to page 2 and edit row 39, home to http://seconddomain.com and click Go.

From reading your first post along with your second, it sounds like you did the correct thing. What may be the problem is that you are seeing a cached version of the second domain.

If the .htaccess file with the code is indeed in var/www/html for the first domain then it would not affect your second domain that is located in /var/www/seconddomain. I think maybe Skyler missed that part.

Something else to remember, is that if you want .htaccess to work for your second domain now you need to edit your httpd.conf with the "AllowOverrides All" directive. Here is what you want the VirtualHost container for your second domain to look like.

The above sets your second domain up pretty much like your primary one so that you can run cgi and Perl scripts along with a couple other things. If you are just running wordpress you shouldn't really need that.

From reading your first post along with your second, it sounds like you did the correct thing. What may be the problem is that you are seeing a cached version of the second domain.

If the .htaccess file with the code is indeed in var/www/html for the first domain then it would not affect your second domain that is located in /var/www/seconddomain. I think maybe Skyler missed that part.

I cleared my browswer cache--no dice. And, yes, the .htaccess file is indeed in var/www/html (it's not affecting the second domain--when I delete it, the second domain still isn't working). Also, BTW, I don't need a .htaccess file for the second domain, but thank you for the extra pointers.

Any other ideas? Is there something else in the httpd.conf file that could be causing the virtual host container for the second domain to be ignored?

Did you make the changes to the VirtualHost container manually in httpd.conf or did you use the Site Manager to delete and then create the second domain again pointing to the new location? If you have not already try restarting your account. If you made your edits manually you would need to do this for the changes to take effect.

I'm sorry you were unable to get this issue resolved. My previous response was looking at the current way things were setup, there was only one WordPress database, so it appeared you were attempting to utilize the default WordPress installation for the secondary domain. I apologize that I misread what you were trying to accomplish. Wildjoker is correct, and here is a fantastic post on setting up a fresh install of WordPress.

BTW--I fixed the problem several months ago. I had to make a change within Wordpress admin for the second domain's wordpress install. I think it was a password or something--maybe it was in the wp-config.php file. Anyway, you guys were very helpful.