Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

.htaccess Help Needed!


Guest

Recommended Posts

Hi everyone,

 

Can someone please give me the right code so that my root directory automatically re-directs to a sub-directory? I know that this has to be done in the .htaccess file on the root directory, but I have no idea what it would look like.

 

Your help, as always, so appreciated!

 

My root directory is: www.mantishockey.com

I want it to auto re-direct to:www.mantishockey.com/store

 

Thanks!

Link to comment
Share on other sites

Hi Vger,

 

Now getting an error message!

 

Internal Server Error

 

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error.

 

More information about this error may be available in the server error log.

 

Any other ideas?

Link to comment
Share on other sites

Can someone please help?

 

 

Try adding this line in your htaccess file (in your root directory):

 

Redirect 301 /index.html http://www.mantishockey.com/store

 

make sure your the URL stated in your htaccess file is pointing to the exact full directory of the file you want a permenant redirect to. are you in the "root" directory?

you access this through your file manager.

your root directory URL will differ from web host to web host. if your not sure email your hosting company they should be more then able to help you.

better yet email them with what you have done and the error message mentioned here.

 

hopes this helps

Link to comment
Share on other sites

Let me start by saying that I do not use any type of SEO rewrites. Because I have found over the years that most if not all have no real value in page ranking. With that said here is how I have modified a OSC site.

 

Editing the root htaccess file and adding to it:

# ReadWrite Rules SkipWater 05.07.08
# OSC installed in subdirectory but want URL to appear as root

Options -Indexes
RewriteEngine on
Options +FollowSymLinks
RewriteCond %{HTTP_HOST} !^www\.mysite\.com$ [NC]
RewriteRule .* http://www.mysite.com/ [L,R=301]
RewriteRule ^$ catalog/index.php [L]
RewriteCond %{DOCUMENT_ROOT}/catalog%{REQUEST_URI} -f
RewriteRule .* catalog/$0 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* catalog/index.php?q=$0 [QSA]

Of course you would change mysite to your url and the directory catalog to your directory name.

 

Next:

I edited includes/configure.php and changed the following that was the default when installed.

define('HTTP_COOKIE_PATH', '/catalog/');
define('HTTPS_COOKIE_PATH', '/catalog/'); 
define('DIR_WS_HTTP_CATALOG', '/catalog/');
define('DIR_WS_HTTPS_CATALOG', '/catalog/');

To this:

define('HTTP_COOKIE_PATH', '/');
define('HTTPS_COOKIE_PATH', '/'); 
define('DIR_WS_HTTP_CATALOG', '/');
define('DIR_WS_HTTPS_CATALOG', '/');

As for the admin side of OSC I made no changes. Because no search engine will ever see this section of the site.

 

NOTE: Make Backups!!!

If only I could remember that.

Link to comment
Share on other sites

  • 2 months later...
Let me start by saying that I do not use any type of SEO rewrites. Because I have found over the years that most if not all have no real value in page ranking. With that said here is how I have modified a OSC site.

 

Editing the root htaccess file and adding to it:

# ReadWrite Rules SkipWater 05.07.08
# OSC installed in subdirectory but want URL to appear as root

Options -Indexes
RewriteEngine on
Options +FollowSymLinks
RewriteCond %{HTTP_HOST} !^www\.mysite\.com$ [NC]
RewriteRule .* http://www.mysite.com/ [L,R=301]
RewriteRule ^$ catalog/index.php [L]
RewriteCond %{DOCUMENT_ROOT}/catalog%{REQUEST_URI} -f
RewriteRule .* catalog/$0 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* catalog/index.php?q=$0 [QSA]

Of course you would change mysite to your url and the directory catalog to your directory name.

 

Next:

I edited includes/configure.php and changed the following that was the default when installed.

define('HTTP_COOKIE_PATH', '/catalog/');
define('HTTPS_COOKIE_PATH', '/catalog/'); 
define('DIR_WS_HTTP_CATALOG', '/catalog/');
define('DIR_WS_HTTPS_CATALOG', '/catalog/');

To this:

define('HTTP_COOKIE_PATH', '/');
define('HTTPS_COOKIE_PATH', '/'); 
define('DIR_WS_HTTP_CATALOG', '/');
define('DIR_WS_HTTPS_CATALOG', '/');

As for the admin side of OSC I made no changes. Because no search engine will ever see this section of the site.

 

NOTE: Make Backups!!!

 

 

Do I add ALL of what you have in the first box of code to add? I wonder if this solution worked for the other fella.

Michelle

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...