Jump to content

Archived

This topic is now archived and is closed to further replies.

nero

How to make myurl.com/ easily redirect to myurl.com/catalog/

Recommended Posts

Hello all -

 

I'm trying to find the best for for when someone goes to http://www.discount-candle.com/ to have their browser load http://www.discount-candle.com/catalog/.

 

There are a few options I've tried:

 

1) FRAME SOURCE W/ REDIRECT

 

<html>

<HEAD>

<!--META HTTP-EQUIV="Refresh" CONTENT=0;URL=http://www.discount-candle.com/catalog/-->

</HEAD>

<title>Discount Candle, Inc</title>

</head>



<frameset rows="*,0" border=no>

 <frame src="http://www.discount-candle.com/catalog/default.php" name="catalog" scrolling="yes" border="no"

        frameborder=0 framespacing=0> 

</frameset>



</body>

</html>

 

Problem with this is that some search engines have trouble using spiders on frames, and your link reputation and keyword density is shit for the top URL on the domain.

 

2. Use an includes file for http://www.discount-candle.com/index.php

 

<?php include('http://www.discount-candle.com/catalog/default.php'); ?>

 

Problem with this is that the session starts with the localhost IP as the IP address of record in the session (since the user is being passed the data through the localhost along with the session data, the user gets the localhost session for loading this page). This doesn't work at all.

 

3. Doorway page

 

Make an index page at the document root that has a "ENTER HERE" to go to /catalog/. Problem with this is that search engines rank less for doorway pages. They want content, which my /catalog/ page has.

 

3. Mod_rewrite?

 

Is mod_rewrite the solution? Does anyone have a way to do this?

 

I think the code for this is:

 

RewriteEngine on

RewriteRule   ^/$  /catalog/  [R]

 

MURGH!!!!

 

I'm sure this is a common problem since a lot of installations default install into /catalog/ and /catalog/admin/. I'd definitely like to keep the source tree in /catalog/ rather than moving it up to the document root and editing my configuration files. It seems that is not the right way to do it.

Share this post


Link to post
Share on other sites

Ummm... er.. I hate to point out the obvious... but you could always move the installation up a directory...??

Then delete the empty catalog folder?

 

But you can accomplish this a number of different ways (via your webserver.. Apache, IIS, etc. all have this ability).

 

I wouldn't suggest redirects or refreshes.. Search Engines hate them.. (although I am currently using them for a couple of sites -- trying to get away from that).

Share this post


Link to post
Share on other sites
..I'd definitely like to keep the source tree in /catalog/ rather than moving it up to the document root and editing my configuration files..

 

Guess I should have read the *entire* post :oops:

 

But really editing the configure.php is not a big ordeal or anything.

Share this post


Link to post
Share on other sites
I'd definitely like to keep the source tree in /catalog/ rather than moving it up to the document root and editing my configuration files.  It seems that is not the right way to do it.

 

I'll do this if it's my last option, but I think keeping the /catalog/ discrete and away from the document root on the physical system is the best way to go. The trick is what is the best way to keep it this way and still have the /catalog/ page load off of document root?

Share this post


Link to post
Share on other sites

create an index.php at the root level...

 

<?    

echo header("Location: http://www.me.com/catalog/default.php");

 exit;

?>

 

or index.html or index.shtml with the following:

 

<META http-equiv="Refresh" content="1; url=http://www.me.com/catalog/defualt.php ">


The king of kluge...

? Do you really know what is and isn't working in your store? ≡ ?

Share this post


Link to post
Share on other sites

What are the downsides of this on the search engine level? Are redirects the best way to go? How about mod_rewrite?

Share this post


Link to post
Share on other sites

I agree with hobbzilla.

 

Forget splash screens/redirects. Go straight to the store in the root - there are too many lazy shoppers in the world ;)

Share this post


Link to post
Share on other sites

Zilla,

 

What are the consequences of using mod_rewrite? From what I know this is probably the "cleanest" solution if I'm reluctant to move /catalog/ to the document root. Would you agree?

 

Andrew

Share this post


Link to post
Share on other sites
What are the downsides of this on the search engine level?  Are redirects the best way to go?  How about mod_rewrite?

 

Many search engines hate redirects your best option is to move the store out of the /catalog/ folder to the root.


Mark Evans

osCommerce Monkey & Lead Guitarist for "Sparky + the Monkeys" (Album on sale in all good record shops)

 

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

Software is like sex: It's better when it's free. (Linus Torvalds)

Share this post


Link to post
Share on other sites

Yes mod_rewrite is probably the 2nd best solution. I am not an Apache guru so I'm unsure what the repercussions are of this.

 

But as I mentioned, the *best* solution is to simply use your directory root as the install path & omit /catalog. I still don't know why you are "holding" on to /catalog. The configure.php edit would take 10 seconds.

 

Let go, Luke. Use the force, Luke. Get rid of /catalog, Luke.

Share this post


Link to post
Share on other sites

Alright alright I've moved it to the / document root! ;) Thanks for your help fellas...

 

Andrew

Share this post


Link to post
Share on other sites

I use a php file called index.php. This is all I have inside it.

 

<?

 

header("Location: catalog/default.php");

 

?>

 

Works fine, I get indexed perfectly.

 

No big deal.

 

H

Share this post


Link to post
Share on other sites

I had exactly the same issue, most search engines just didnt like me when I done a mod rewrite, and ended up moving stuff to the 'root' dir, ok its messy, but its alot better for indexing.

 

John

Share this post


Link to post
Share on other sites

Winteradio,

 

isn't that still re-directing?


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

NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit.

If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help.

Share this post


Link to post
Share on other sites
<?



header("Location: catalog/default.php");



?>

 

This is not right, the URL for the header *must* be an absolute URL eg

 

<?



header("Location: http://www.yourdomain.com/catalog/default.php");



?>

 

else some clients won't accept it. rfc2616 14.30 if interested :wink:

 

For the original poster, best to worst (IMHO):

 

1) move catalog to root

2) mod_rewrite

3) index.php > catalog/index.php (see above)

4) plain textual link "click here to go to our catalog"

5) javascript refresh

 

HTH :)


Help shape the future of Phoenix; join the Phoenix Club

Share this post


Link to post
Share on other sites

This might be a stupid question, but why not just copy the default.php to the webgroot with a few modifed paths?


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

NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit.

If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help.

Share this post


Link to post
Share on other sites

Ahh, I see now that all of the paths are refered to by reference.


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

NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit.

If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help.

Share this post


Link to post
Share on other sites

Hello,

 

I have tried to move the files and change the Configure.php files and I am still hitting a wall. Can any one tell me what configure.php file need to be changed in order to get my cart to run properly.

 

When I move the file to root and change the configure.php files in the /includes dir I am getting no images and when I select a product it goes to a bad page.

 

I know I am almost there, but I need some expert advice.

 

 

Thanks in Advance,

 

Vince :D

Share this post


Link to post
Share on other sites

Well,

 

I'm assuming you just moved all the "files" in .../root_dir/catalog up a directory so they would be in the root directory right?

 

Did you think about moving the rest of the files (within their respective folders) up a level too? I mean, you should not even HAVE a catalog folder any more. It should just be:

 

/root_dir

/download

/images

/includes

account.php

account_edit.php

.

.

.

 

Make sense?

Share this post


Link to post
Share on other sites

You need to move every file, not just the configure.php.

 

Another option that no-one has mentioned is to change the DocumentRoot in the httpd.conf file for a particular domain.

 

Thus:

 

<VirtualHost ip.ad.re.ss>

ServerAdmin webmaster@yourdomain.com

ServerName yourdomain.com

ServerAlias www.yourdomain.com

DocumentRoot /home/yourdomain/public_html/catalog

</VirtualHost>

 

This is most likely done in the file include.httpd.conf but varies from host to host. If you have a good relationship with your host, they will do this for you, its a 30 second SSH login, run 2 commands and thats it.

 

If you have root, then all you need to do is edit include.httpd.con and restart apache. Done.


Help shape the future of Phoenix; join the Phoenix Club

Share this post


Link to post
Share on other sites

Hi Hobzilla,

 

Yes I did do that. I am just unclear on what changes to make in the configure.php file and in what directories to make them. I moved the entire contents of the catalog dir to root. And made the configure.php file changes in the /includes/configure.php file.

 

What lines do I have to change in that file? Is it the "absolute path" only? or do I need to redifine where my images are? Here is is my current configure.php file for the /include in the catalog area. I know I will have to change it in the admin area to right?

 

 

Thanks a mil!

 

Vince

 

 

define('ENABLE_SSL_CATALOG', 'false'); // secure webserver for catalog module

define('DIR_FS_DOCUMENT_ROOT', '/home/sites/site8/web'); // where the pages are located on the server

define('DIR_WS_ADMIN', '/admin/admin/'); // absolute path required

define('DIR_FS_ADMIN', '/home/sites/site8/web/admin/admin/'); // absolute pate required

define('DIR_WS_CATALOG', '/home/sites/site8/web'); // absolute path required

define('DIR_FS_CATALOG', '/home/sites/site8/web/catalog/catalog/'); // absolute path required

define('DIR_WS_IMAGES', 'images/');

define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');

define('DIR_WS_CATALOG_IMAGES', DIR_WS_CATALOG . 'images/');

define('DIR_WS_INCLUDES', 'includes/');

define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');

define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');

define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');

define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');

define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');

define('DIR_WS_CATALOG_LANGUAGES', DIR_WS_CATALOG . 'includes/languages/');

define('DIR_FS_CATALOG_LANGUAGES', DIR_FS_CATALOG . 'includes/languages/');

define('DIR_FS_CATALOG_IMAGES', DIR_FS_CATALOG . 'images/');

define('DIR_FS_CATALOG_MODULES', DIR_FS_CATALOG . 'includes/modules/');

define('DIR_FS_BACKUP', DIR_FS_ADMIN . 'backups/');

Share this post


Link to post
Share on other sites

The most simple way is to create a symbolic link of index.php pointing to catalog folder.

 

ln -s /home/mydomain/www/catalog index.php

 

Basicly, when customer goes to your root directory, which is the same as your catalog folder!!!

 

Regards,

Bn

Share this post


Link to post
Share on other sites

I was wrong earlier. It should be like this!!!

 

ln -s catalog/default.php default.php

ln -s catalog/includes includes

 

Regards,

Bn

Share this post


Link to post
Share on other sites

×