Web Hosting Forum | Lunarpages
News: October 6, 2008 - Submit Your Site for the October 2008 Site of the Month!
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
October 14, 2008, 01:11:30 AM


Login with username, password and session length


Pages: [1]   Go Down
  Print  
Author Topic: setting up a 2nd word press blog under a 2nd domain site problem  (Read 180 times)
dowsp
Pong! (the videogame) Master
*****
Offline Offline

Posts: 28


« on: July 01, 2008, 02:59:12 PM »

Hello

I have a few domains (about 5) set up on my host account.

I set up a wordpress blog a few weeks ago for my MAIN domain and I was able to get it to work OK.

I have recently been trying to set up a 2nd blog for my 2nd domain..

When I set up my 2nd domain  after initially registering the domain I had to add it to the addon domain within cpanel
and do something else to get the name to show up as www.domain2.com  and NOT as www.domain1.com/domain2 which If I recall it had done.

I then set up a 2nd folder within  my public_html folder for my 2nd domain

So now when I create any new files within this folder they show up with the 2nd domain in front..
eg ... www.domain2.com/abc or xyz or  what ever.

when I set up a blog for my MAIN domain... ie    www.domain1.com  I created a new folder called 'blog' within the public_html folder.  Then I FTP'd the wordpress files into this folder... This then worked fine after I had also created a database in mysql.


For my attempt tp set up a 2nd blog for my 2nd domain... I set up a folder inside the domain2 folder called blog and I did the same things that I did for the 1st blog... ie I  FTP'd  the files of the 2nd wordpress blog into my domain2 blog folder.

I managed to get files into the folder ok and I then installed it.. I was given a Username and password and able to log into my new 2nd blog..

when I click on the index.php file within my 2nd domain blog folder, it opens up OK to the correct page in visual terms  BUT the domain name is shown as  www.domain1.com/domain2/blog/index.php


when I write in my new blog domain....    www.domain2.com/blog  it opens up as www.domain1.com/blog and is the actual domain 1s blog.

I want it to JUST open as www.domain2.com/blog

Can anyone tell me if you can set up more than one blog per host account and if so HOW do I overcome my problem.

I was wondering If I had to do something else within cpanel.. I DID set up a 2nd database for blog 2 in mysql by the way.

Any help greatly appreciated.

many thks in advance

Dowsp.











 







Logged
MrPhil
Quantum Encyclopedia Writer
*****
Offline Offline

Posts: 3400



« Reply #1 on: July 01, 2008, 05:17:16 PM »

When I set up my 2nd domain  after initially registering the domain I had to add it to the addon domain within cpanel
and do something else to get the name to show up as www.domain2.com  and NOT as www.domain1.com/domain2 which If I recall it had done.

I then set up a 2nd folder within  my public_html folder for my 2nd domain

Eh? When you create an add-on domain via cPanel, it will create the root level directory (public_html/domain2/) for you. There's nothing for you to manually add.

Quote
when I click on the index.php file within my 2nd domain blog folder, it opens up OK to the correct page in visual terms  BUT the domain name is shown as  www.domain1.com/domain2/blog/index.php

If you put code in public_html/.htaccess to change the name from www.domain1.com/domain2/  to www.domain2.com/, it should fix all references. Perhaps it's incorrectly coded so that it handles the top level OK, but ignores lower level directories. Could you show us your all your .htaccess files? Please scrub out any sensitive information first.

Quote
I want it to JUST open as www.domain2.com/blog

Are you saying that domain2's blog shows up in some circumstances as domain1's blog? Again, I'd suspect a bad .htaccess.

Quote
Can anyone tell me if you can set up more than one blog per host account and if so HOW do I overcome my problem.

Of course you can. Let's start with a look at your .htaccess files, especially any URL rewriting you do.

Quote
I was wondering If I had to do something else within cpanel.

Don't use cPanel for redirection operations on subdomains or add-on domains -- it breaks.

By the way, are you using redirection or a dummy index.html to jump from public_html/ to public_html/blog/index.php and likewise for domain2? Or are you just doing it manually or with some sort of Home Page with links? If you used redirection in cPanel, it probably generated bad code.
Logged

dowsp
Pong! (the videogame) Master
*****
Offline Offline

Posts: 28


« Reply #2 on: July 01, 2008, 06:57:40 PM »

Hi Phil (AKA Matt hooper R.D (Jaws))   Smiling

thank you for your reply. much appreciated


Your reply reminded me of that extra thing that I had to do when I added on my 2nd other domains on top of addon in cpanel.

ie your reference to the public_html  .htaccess

The trouble is it was about 12 months ago and I am struggling to recall exactly what I did.

but I think I found the relevant file.. I have deleted parts of the domain names and replaced with some xxxs

Can I ask , can I send you a copy of the file privately if you need the full file details.

I noted that one of my other domains doesnt semed to have been added for some reason , maybe I overlooked it at the time.



RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?.*internetxxxx.com(/)?.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www\.)?gxxxsxxcles.com(/)?.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www\.)?secxxxx.com(/)?.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www\.)?lunarforums.com(/)?.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www\.)?stretxxxx.com(/)?.*$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?stxxxx.com(/)?.*$
RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ gaxxxx.com [R,NC]

------------

Eh? When you create an add-on domain via cPanel, it will create the root level directory (public_html/domain2/) for you. There's nothing for you to manually add.  OK



If you put code in public_html/.htaccess to change the name from www.domain1.com/domain2/  to www.domain2.com/, it should fix all references. Perhaps it's incorrectly coded so that it handles the top level OK, but ignores lower level directories. Could you show us your all your .htaccess files? Please scrub out any sensitive information first.


see above



Are you saying that domain2's blog shows up in some circumstances as domain1's blog? Again, I'd suspect a bad .htaccess.

  yes



Don't use cPanel for redirection operations on subdomains or add-on domains -- it breaks.

By the way, are you using redirection or a dummy index.html to jump from public_html/ to public_html/blog/index.php and likewise for domain2? Or are you just doing it manually or with some sort of Home Page with links? If you used redirection in cPanel, it probably generated bad code.

No I wasnt using redirection as far as I am aware.. I assume some how something wasnt set up right to allow the domain 2 to accept a 2nd blog, so it refers to the main domain blog instead... but I do find it confusing and I only know the very basics of setting things up.




Hopefully you may be able to tell from the.htaccess  file details I sent.


Thnk you

Dowsp
Logged
MrPhil
Quantum Encyclopedia Writer
*****
Offline Offline

Posts: 3400



« Reply #3 on: July 02, 2008, 04:54:34 PM »

The .htaccess segment you sent is the "hotlink protection". It prevents other pages and sites from "borrowing" your images (serving them from your site). It has nothing to do with redirection or the blog.

By any chance did you copy  over an existing WordPress installation (domain1.com) to your new blog (domain2.com), rather than a fresh install? Maybe you neglected to update some configuration file that uses domain1.com somewhere.

I've been told by a number of people that I strongly resemble Richard Dreyfuss, so I use that Jaws  still as my avatar.
Logged

dowsp
Pong! (the videogame) Master
*****
Offline Offline

Posts: 28


« Reply #4 on: July 02, 2008, 08:15:37 PM »

Hi Phil

I did upload the wordpress blog to each domain using FTP.

So to confirm I initially uploaded blog 1 to domain 1 and installed it ok , I a;sp managed to  get it to work OK and get the name to also read www.domain1.com/blog 

For the 2nd domain , I uploaded a 2nd  wordpress blog set of files using FTP and I did add and create a new data base in Mysql and I made changes within  the wp.config/php file so that both the  username and password of the new 2nd domain data base details  of the new wordpress blog would be recognised by the domain 2 name.
I also had added  each users to each data base..

so for domain1 and blog 1 that user 1 was set to database 1 ..... and for domain 2 and blog 2 ...user 2 was set to database 2

As I say then I added relevant details to each wp.config.php files

So as far as I am aware there should not be any confusion between both domain 1 and blog 1 and the domain 2 and blog 2 files.


heres the top  part of blog 1s wp.config.php file for domain 1 (I changed some details but the layout shows what I did and how the details are different)

<?php
// ** MySQL settings ** //
define('DB_NAME', 'domain1_blog');    // The name of the database
define('DB_USER', 'domain1_dowsp');     // Your MySQL username
define('DB_PASSWORD', 'xxxxxx'); // ...and password
define('DB_HOST', 'localhost');    // 99% chance you won't need to change this value
define('DB_CHARSET', 'utf8');
define('DB_COLLATE', '');




heres the same details for blog 2 domain 2 wp. config.php file


<?php
// ** MySQL settings ** //
define('DB_NAME', 'domain2_smsblog');    // The name of the database
define('DB_USER', 'domain2_sms');     // Your MySQL username
define('DB_PASSWORD', 'xxxxxx'); // ...and password
define('DB_HOST', 'localhost');    // 99% chance you won't need to change this value
define('DB_CHARSET', 'utf8');
define('DB_COLLATE', '');




As far as I am aware there shouldnt be any configuration problem.

I was thinking maybe the .htaacess file may have needed ammeding when you mentioned it !


Maybe it is something else that I have failed to do correctly.

Cheers Dowsp




The .htaccess segment you sent is the "hotlink protection". It prevents other pages and sites from "borrowing" your images (serving them from your site). It has nothing to do with redirection or the blog.

By any chance did you copy  over an existing WordPress installation (domain1.com) to your new blog (domain2.com), rather than a fresh install? Maybe you neglected to update some configuration file that uses domain1.com somewhere.
Logged
Vitalian
Spaceship Navigator
*****
Offline Offline

Posts: 75



« Reply #5 on: July 03, 2008, 07:10:59 AM »

Try checking http://www.domain1.com/domain2/blog/wp-admin/options-general.php and make sure that both URL fields contain the right addresses (i.e., http://www.domain2.com/blog/). WordPress uses a PHP based redirection when you access the site to redirect browsers to the URLs contained in these fields.

I had a similar problem with a local install of WordPress on my LAN. Since I used the server-computer to run the install script, the field values were set to a loopback address instead of the proper LAN address.

If that doesn't help, you may want to look for .htaccess files in sub-directories. Hope it does help though.
Logged
dowsp
Pong! (the videogame) Master
*****
Offline Offline

Posts: 28


« Reply #6 on: July 03, 2008, 09:37:10 PM »

Hi Vitalian ,

Thank you for your reply.

I have had a look at the file that you describe but I am not 100% sure or clear on what you refer to.
When you say make sure that both URL fields contain the right addresses for domain2.com/blog, I assume that you mean that somewhere that this should be within the html or php type of code that is within this page when I click on  edit page ,, this allows me to check within the file details. , and it is not just a case of me checking what the file title says if you mean for me to check the title when I click on the wp-admin/options-general.php file within my domain2/blog2 folder... if this is the case then it does still  read as ..............

http://www.domain1.com/domain2/blog/wp-admin/options-general.php   and NOT as Ideally Id like to see it.

http://www.domain2.com/blog/wp-admin/options-general.php


So I would imagine that because this url does still include the domain1 in the title this is why it still shows up when I try and write it in my browser with dormain1 in front of it.

when you say....

If that doesn't help, you may want to look for .htaccess files in sub-directories.

Can I ask  should there be .htaccess files in all of my domain folders apart from just within my MAIN domains folder  .. when you say   sub-directories does this mean other domain folders?

I can only see the .htaccess file in my MAIN public_html folder..

Are you suggesting that I should also have one in my domain2 folder as well ?

Best Regards
Dowsp


Try checking http://www.domain1.com/domain2/blog/wp-admin/options-general.php and make sure that both URL fields contain the right addresses (i.e., http://www.domain2.com/blog/). WordPress uses a PHP based redirection when you access the site to redirect browsers to the URLs contained in these fields.

I had a similar problem with a local install of WordPress on my LAN. Since I used the server-computer to run the install script, the field values were set to a loopback address instead of the proper LAN address.

If that doesn't help, you may want to look for .htaccess files in sub-directories. Hope it does help though.
Logged
dowsp
Pong! (the videogame) Master
*****
Offline Offline

Posts: 28


« Reply #7 on: July 04, 2008, 01:42:57 AM »

Hi Phil / Vitalian,

I THINK that I have solved my problem.

This is a message that I replied to on the wordpress.orgs forum

I had basically to change the domain within my domain2 blog2s dashboard settings - general and change the domain so that it didnt have the main domain in front of it.

Many thks for your help

Hopefully this will enable me to sort out all my other blogs as well following the info in each.

I had just found wordpress.com and set up a blog in their site but it still had the wordpress name in it.

ie  www.abcxyz.wordpress.com  instead of www.abcxyz.com/blog


I found a FAQ page on wordpress.coms site about how to remove the wordpress name out of the domain.

this helped me work out from the other posts that I had received on the wordpress.org sites forum.


cheers dowsp


Hi Michael,

Sorry I had initially misunderstood your comments.

I was thinking that you referred to something directly in my host accounts settings, BUT I NOW think that you mean within my wordpress blogs settings on dashboard within each blog.

I THINK that I have now managed to do what you said..

I was able to change the relevant details within my blogs dash board settings general tab and alter the dormain to just read the 2nd domain name only.. so it now only reads www.domain2.com/blog and not
www.domain1.com/domain2/blog.

can I ask what was the other code used for that you suggested that I add in to the files code ? I am not clear why I need that ?

<?php
/* Short and sweet */
define('WP_USE_THEMES', true);
require('./wordpress/wp-blog-header.php');
?>



Many thanks for your advice.

cheers Dowsp




Then for each blog I'd login, access Settings->General, and delete the /wordpress off the end of Blog address (URL). Leave the WordPress address (URL) alone. Then log-out!

Then I'd upload the following index.php into public_html and public_html/domain2
Logged
Vitalian
Spaceship Navigator
*****
Offline Offline

Posts: 75



« Reply #8 on: July 04, 2008, 01:54:00 AM »

I see, small mix up with what I said. I meant for you to check the file in your browser. That page manages your blog settings.

In response to whether each directory should have a .htaccess file, the answer is definitely no. Whenever someone makes a request for a page, the web-server searches for a .htaccess file. It reads the .htaccess file on every request. This can cause major processor overhead when there is a .htaccess file in every directory. But, sometimes you may have a .htaccess file in certain directories if something needs rewrite. I thought you may have possibly had a .htaccess file in your other directory, but if not, now worries.

^^ Hope that helps
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.6 | SMF © 2006-2008, Simple Machines LLC

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM