1
jfmoore
Install Xoops in sub-directory?
  • 2004/11/9 13:01

  • jfmoore

  • Quite a regular

  • Posts: 360

  • Since: 2004/6/6 5


I would like to install XOOPS in a sub-dir, say xyz.com/site and then have xyz.com redirected to xyz.com/site.

Is this a good thing to do?

Is there a way to accomplish this redirection so as not to mess up search engine indexing?

JFM

2
Stewdio
Re: Install Xoops in sub-directory?
  • 2004/11/9 13:10

  • Stewdio

  • Community Support Member

  • Posts: 1560

  • Since: 2003/5/7 1


This was asked just yesterday in fact, you can see the post here.

3
jfmoore
Re: Install Xoops in sub-directory?
  • 2004/11/9 15:28

  • jfmoore

  • Quite a regular

  • Posts: 360

  • Since: 2004/6/6 5


Thanks for the reply, but that's not the same question at all. I am already running multiple test sites and have no problem with that.

The question is:

1. When I get ready for a live site, and I am nearly there, where should it go? I would like to install it in /site, but then would have to redirect xyz.com to xyz.com/site.

2. Can this redirection be done without confusing search engines, and, if so, how would it best be accomplished? Someone already doing this maybe?

Or, should it just be installed in the root directory and be done with it?

I want to do it the right way the first time.

JFM

4
ackbarr
Re:Install Xoops in sub-directory?

jfmoore - here is a great article I found via google that discusses redirection and its effects on search engine rankings:

http://www.netmechanic.com/news/vol4/promo_no15.htm

In the article they mention using server side redirection. To create a server side redirection script in PHP you can create a file in your web root directory - index.php:

<?php
header
("Location: http://www.yourxoopsurl.com/site/"); /* Redirect browser */

/* Make sure that code below does not get executed when we redirect. */
exit;
?>

5
Stewdio
Re:Install Xoops in sub-directory?
  • 2004/11/9 15:46

  • Stewdio

  • Community Support Member

  • Posts: 1560

  • Since: 2003/5/7 1


All you have to do is go to /site, and edit mainfile.php to reflect your site root. It does not matter what folder it is in and you can run multiple XOOPS site in this manner, so yes, it partialy answers your question. You can install and run multiple sites like xyz.com/site, xyz.com/site2, xyz.com/site3 and so on down the line.

So your mainfile.php should have path/to/site, path/to/site2, etc.

When people go to xyz.com, you will have to provide a link to xyz.com/site if you do not use your public root (user/path/to/html/) where /html is your site root.

If you put xyz.com in your mainfile.php, then when users click on home and when you leave the admin panel, you will be brought to xyz.com and NOT xyz.com/site

If you put xyz.com/site in your mainfile.php, then your users will go to the proper place when they click "Home" in your XOOPS site and you will not be redirected to xyz.com when you clike home int he admin panel.

Now, to redirect users going to xyz.com to xyz.com/site, you will need to create an .htaccess file in place it in your site root. All you need to do is put a redirect in your .htacess file like so:

Redirect /http://www.xyz.com/site

Whats important is your mainfile is set up to go to xyz.com/site, but since you have the redirect, it won't realy matter. It is safer to make sure you have the right path in your mainfile.php and not explicitly rely on your htaccess redirect because if you don't have the redirect and don't specify /site in your mainfile.php, then users will end up at xyz.com, not xyz.com/site

I hope this clarifies things a bit better.

Everything is easy to set up and maintain in this manner, I do it all the time for many reasons.

6
jfmoore
Re:Install Xoops in sub-directory?
  • 2004/11/9 17:25

  • jfmoore

  • Quite a regular

  • Posts: 360

  • Since: 2004/6/6 5


Thanks for both replies. Great information!

Question re using php: Apparently the .htaccess method is ok with search engines. What about the php method? Seems efficient and easy.

Question re using .htaccess: There is already an .htaccess file in my public_html directory, apparently set up when domain was created. If I were to use this method, would I just add the redirect line to the end?

Question re both: Is there an advantage to using one method over another?

Thanks again.

JFM

7
Stewdio
Re:Install Xoops in sub-directory?
  • 2004/11/9 17:33

  • Stewdio

  • Community Support Member

  • Posts: 1560

  • Since: 2003/5/7 1


It been hotly debated over what method is best, as each have their own drawback on server load when these files get rather large. For your purposes and in general, there is no real difference between one method over the other.

Personally, I use .htaccess.

Yes, just add the line of code to your current file, it will work just fine.

8
ackbarr
Re:Install Xoops in sub-directory?

since both methods cause a HTTP Error Code 302 to be sent to the user-agent, I don't think there is a practical difference to the two methods for search engines. On a busy site, I would expect the .htaccess method to perform slightly better, because apache can return the 302 error without having to load the apache PHP module.

You should be able to add the .htaccess rule to the bottom of your existing .htaccess file without issue.

Login

Who's Online

120 user(s) are online (75 user(s) are browsing Support Forums)


Members: 0


Guests: 120


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits