Page 1 of 1
Access by Subdomain and directory
Posted: Sat May 14, 2005 1:26 pm
by robert
Hello,
I tried it, but I´m not a proffessional
Is there a way to have access to my blog with
http://mydomain.at/blog AND
http://blog.mydomain.at
Regards
Robert
Re: Access by Subdomain and directory
Posted: Sat May 14, 2005 2:27 pm
by garvinhicking
This is a serious problem, because the one domain would have a /blog subdirectory and the other would not.
Basically it would work if you enable HTTP Host autodetection in the s9y configuration; then you could use any hostname to access your document root for serendipity.
HOWEVER your visitors of blog.mydomain.at could view entries where you referenced an image with /blog/uploads/xxx.jpg and then they would not see the picture because /blog/ does not exist for them.
So I think in your case it would be the wisest thing to do to redirect either frmo blog.yourdomain.at to yourdomain.at/blog or the other way around (with a simple PHP script:
Code: Select all
<?php
header('Location: http://yourdomain.at/blog/index.php');
?>
Regards,
Garvin
Posted: Sat May 14, 2005 2:35 pm
by robert
Thanks!
Redirection seems to be also a good solution. I try it!
Regards
Robert
Re: Access by Subdomain and directory
Posted: Mon May 30, 2005 8:25 pm
by jocose
garvinhicking wrote:So I think in your case it would be the wisest thing to do to redirect either frmo blog.yourdomain.at to yourdomain.at/blog or the other way around (with a simple PHP script:
Code: Select all
<?php
header('Location: http://yourdomain.at/blog/index.php');
?>
Regards,
Garvin
I am trying to do the same thing-- have my blog in a subdomain, so you would go to blogs.mydomain.com.
I'm brand-spanking-new to all of this (I've been using livejournal, but am ready to step up to doing it myself).
Anyway, where do I put the php script you are talking about? And where do I put the files? I'm assuming that I would put the files in
www.mydomain.com/files/ and then use the script to point folks to blogs.domain.com/myblog ?
Anyway, thanks so much in advance for helping a newbie

Re: Access by Subdomain and directory
Posted: Tue May 31, 2005 5:04 pm
by garvinhicking
You would install Serendipity into the directory you want to primarily use. Let's say this is
www.mydomain.com/blog.
Now if you want to have your blog also work at blog.mydomain.com you would store the index.php file in the subdirectory of the root of your blog.mydomain.com document root. No serendipity files should be there, and the small php script will then redirect you to
www.mydomain.com/blog/index.php
HTH and Regards,
Garvin
Posted: Tue May 31, 2005 9:36 pm
by jocose
Garvin,
Thanks for the reply.
I hope you don't mind, but I still have some questions (as I said, I'm brand new to all of this. I really don't know much about computers from this end).
I really want to have people seeing "
http://blogs.mydomain.com/jocose" in their address window. If I understand correctly, this is not a "real" directory, so all of the relative path stuff is a problem. Again, if I'm understanding correctly, I should put all of my files in a folder called
www.mydomain.com/blogs/jocose.
Once I have done that, put my index.php file into the blogs.mydomain.com/jocose folder. From there, I can tell people to go to
http://blogs.mydomain.com/jocse. Once people go there, the php script in the index.php file will redirect them to
www.mydomain.com/blogs/jocose. I think I got that.
Now, here are my questions. 1) is the index file I put in the subdomain my serendipity index, or just an index file with only that redirect code? 2) if it is the second, then is that really any different than having an index file with a meta refresh tag in it, sending you to the other location? If not, then 3) with the serendipity index file (and the code you gave me), will people continue to see
http://blogs.mydomain.com/jocose... no matter what link they click on in my blog?
Thanks, and I hope these aren't too dumb of questions.
Posted: Tue May 31, 2005 10:39 pm
by garvinhicking
Okay, I try to keep it simple:
1. Install Serendipity into the directory where "
http://blogs.mydomain.com/jocose/" points to.
2. Setup Serendipity to use "
http://blogs.mydomain.com/jocose" as the BaseURL.
3a. Here I am not sure. It seems that both "
http://www.mydomain.com/blogs/jocose" and "
http://blogs.mydomain.com/jocose" point to the same directory on your server? In that case you will not need ANY relocating URLs, as Serendipity will work in both directories.
3b. If those two directories are NOT the same, then put the "header: Location..." index.php file into your directory for "
http://www.mydomain.com/blogs/jocose". Then all users entering there will be redirected to your final page. You are right that this index.php file does nothing different than a HTML file with a meta refresh tag. The only difference being that the index.php solution is faster for the user's browser and that the protocol specifies the relocation and not the browser itself.
I hope that helps?
Regards,
Garvin
Posted: Wed Jun 01, 2005 2:14 am
by jocose
Garvin,
Thanks again. I will try it tonight. I did try it before, but alas, it didn't work. I think though, that it may have been because I installed it through the pre-existing system that GoDaddy.com has. I will try downloading the files and uploading them myself.
I'll let you know how it turns out.
Oh, two final questions (for tonight

):
1) I am going to completely remove it and start from scratch, including my database...so, is there a way to back up what I already have on there? If not it's no biggie; It's all still safe at LiveJournal (jo_cose if you want to read the ramblings of a bored US Civil Servant).
2) If I create a random index.html file with that code in it, can I use it like any HTML META file? That is, for whatever reason, at GoDaddy, if you type
http://blogs.mydomain.com/jocose you get redirected to
http://www.mydomain.com/jocose, but if you type blogs.mydomain.com/jocose/, you go to the correct place. So, currently, I have an HTML file in
www.mydomain.com/jocose pointing back to blogs.mydomain.com/jocose/
Thanks again, and have a good night

Posted: Wed Jun 01, 2005 4:15 pm
by garvinhicking
Good luck for your try then!
About backing up: You can save the "serendipity_entries", "serendipity_entrycat" and "serendipity_categories" SQL tables and just re-import them over the new ones. Then your old data will be restored, as your old tables are used then.
About the second question, it somehow confuses me

It just seems that GoDaddy does really do some strange forwarding; usually this shouldn't happen. If you use the header/PHP code, you must point it in a index.php file so that PHP can be parsed....
Regards,
Garvin
Posted: Wed Jun 01, 2005 4:43 pm
by jocose
Garvin,
I'm about to give up and just go back to LiveJournal.
I started all over and deleted everything.
I created a subdomain called blogs. Then I created a folder in there called jocose. I uploaded Serendipity into that folder. Then I went to
Http://www.mydomain.com/jocose/ and ran the install. I left all the path stuff what automatically appeared execpt the URL to Blog field, and in that I put "htt://blogs.mydomain.com/jocose".
It all seemed to work fine. So, then I went to
http://blogs.mydomain.com/jocose/ and the page was actually there (except all the graphics are missing). So, I tried to dispay one of the graphics in a new window and it was trying to find "
http://blogs.mydomain.com/blogs/jocose/ ... mg/xml.gif". So, it appears that the same thing is happening...Serendipity is still trying to find the folder at blogs.mydomain.com/blogs.
I tried to call GoDaddy last night, and they told me that it's a 3rd-party issue so they can't help me.
I think that this is knowledge beyond me.
Posted: Wed Jun 01, 2005 5:06 pm
by garvinhicking
I'm not trying to be offensive, but I think you're trying to do too much above your experience. You should better only install Serendipity on one single location and only use one URL for Serendipity.
It seems you installed Serendipity into
Http://www.mydomain.com/jocose/, but I said you need to install it in htt://blogs.mydomain.com/jocose - Serendipity needs to find it files there where you point the URL to!
So if you want to have any symbolic linking or stuff, you will need to to redirection. I don't know anything about your FTP layout, so I can't really help you further. As it seems to also confuse you, I think the best way is to not use any second URL to access Seendipity, and stick with one URL.
Using LiveJournal, you won't have this option either
Regards,
Garvin
Posted: Wed Jun 01, 2005 6:16 pm
by jocose
No offense taken...I said from the beginning that I don't know what I'm doing
I think that I'm going to do it the simple way for now, but it still seems that I should be able to do what I want...
Just to finish thos off...
In my GoDaddy account setup, I can create a subdomain (forwarded to a hosting subdirectory)...That is where I created "blogs". Once that is active, I went into my account via FTP (Fetch) and created a new directory called "jocose". I uploaded all of the Serendipity files to that account and then pointed my browser first to
http://blogs.mydomain.com/jocose/. That didn't work as it tried to find
http://blogs.mydomain.com/blogs/jocose/. So then I tried to install it by pointing my browser to
http://www.mydomain.com/blogs/jocose/
As I said, I'm giving up (for now). I guess at this point I have 3 options:
1) go back to LiveJournal
2) go to blogger.com, where I can have my blog pointed to
http://blogs.mydomain.com/jocose/, or
3) get rid of the subdomain altogether and just create a folder and install Serendipity to that folder.
Anyway, thanks for trying.