Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

url: www.mydomain.com vs www.mydomain.com/catalog/


Cisco

Recommended Posts

This is the latest error code I received:

 

Forbidden

You don't have permission to access / on this server.

 

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

Link to comment
Share on other sites

The error you are getting will not be cured by moving from 'catalog' to the root of your web. Try typing in www.yourdomain.com/catalog instead of www.yourdomain.com/catalog/

 

It should work either way, but obviously the server your site is on is not set up to work with the trailing slash.

 

If you want to move from 'catalog' to the root of your web, then all you need do is the following:

 

Download the contents of the 'catalog' folder, and then upload the contents of the 'catalog' folder into the root of your web. Once you've done that go (via FTP) to your includes/configure.php file and to your admin/includes/configure.php file and edit out the references to 'catalog'.

 

If you have password protected your 'admin' folder at www.yourdomain.com/catalog/admin you will now have to protect it at www.yourdomain.com/admin.

 

Also, it is advisable to rename your 'admin' folder to something else (you can do this via FTP) and to edit the two references to /admin/ to /newname/ in your admin/includes/configure.php. If you do this then do it before password protecting the folder in its new location.

 

Vger

Link to comment
Share on other sites

Thanks for the help!

 

It fixed the web address problem, but I still have a problem with the finding where to change the "admin" name to what I want. I did change the file but have not been able to make the web pages find the file.

Link to comment
Share on other sites

This is the error I get:

 

Warning: fopen(/home/content/C/i/s/XXXXX/html/admin/includes/configure.php): failed to open stream: No such file or directory in /home/content/C/i/s/XXXXX/html/install/templates/pages/install_7.php on line 261

 

Warning: fputs(): supplied argument is not a valid stream resource in /home/content/C/i/s/XXXXX/html/install/templates/pages/install_7.php on line 262

 

Warning: fclose(): supplied argument is not a valid stream resource in /home/content/C/i/s/XXXXX/html/install/templates/pages/install_7.php on line 263

 

 

Where it says admin is the renamed admin file. I am unable to locate what is referrencing back to admin?

Link to comment
Share on other sites

You're still working on an install?

 

Don't rename admin before you finish. Let the installer run then rename it.

 

Once you rename it you'll need to edit the configure.php file to compensate for the new name.

 

You could just edit the two configure.php files right now and skip the installer. You'd be done.

Local: Mac OS X 10.5.8 - Apache 2.2/php 5.3.0/MySQL 5.4.10 • Web Servers: Linux

Tools: BBEdit, Coda, Versions (Subversion), Sequel Pro (db management)

Link to comment
Share on other sites

I found another way to do this:

 

If yo uchange the file name "admin" before the install. You have to go through the following:

 

install/templates/pages/install_7.php

 

In instal_7.php search for all the references to admin and change them to your new admin file name. There are a few of them that you will not have to change only where a file name is referenced.

 

I know this is probably not a good way to do this, but it works if your stuck.

Link to comment
Share on other sites

How do you change your site to use the following?

 

url: www.mydomain.com vs www.mydomain.com/catalog/

 

Dunno if this is what your looking for but while searching for another situation of mine I thought I would toss in this to see if you or maybe someone else could use this code to override the /catalog path seen in the addy line ... Just a simple php redirect so that no paths are seen in the address line.

 

Toss it in your root with your domain path changes ... I just called it index.php

 

It doesnt change any directory structure but makes it "look" like it does.

 

<?

// PHP?dir is a simple PHP-script to make simple URL's

// Created by You?

// http://www.you.com

 

 

/* You can add url's in the form "namepage" => "http://url.com/page.html"

with a comma between the different naam => url's (see example)

This will give the page url.com/thispage.php?page=namepage

It also works when you use other variables in the url as url.com/thispage.php?page=index&test=525 .

Then it adds the extra variable (test=525) also to the base url (http://url.com/test/page/

becomes http://url.com/test/page/?test=525) */

 

$url = array(

"index" => "http://www.yourdomain.com/catalog/",

"news" => "http://www.yourdomain.com/news or whatever/",

"test" => "http://www.yourdomain.com/blah blah blah/",

// get the picture?

);

 

//Other options

$title="Whatever you want here"; //Enter the page title

$keywords="Whatever you want here too"; //Enter the page keywords

$description="And again whatever you want here"; //Enter the site description

 

// Do not edit below

if (array_key_exists($page,$url)){}

else {$page="index";}

if ($page=="")

{$page="index";}

$templink="page=$page&";

$tempurl1=str_replace ($templink, "", "$QUERY_STRING");

$templink="&page=$page";

$tempurl2=str_replace ($templink, "", "$tempurl1");

if ($tempurl2=="page=$page")

{$tempurl2="";

$vraag="";}

else

{if ($tempurl2=="") {$vraag="";}

else{

$vraag="?";}

}

$newurl="$url[$page]$vraag$tempurl2";

?>

 

<HTML><HEAD>

<meta name="keywords" content="<? echo("$keywords"); ?>">

<meta name="description" content="<? echo("$description"); ?>">

 

<TITLE><? echo("$title"); ?></TITLE>

</HEAD>

<FRAMESET rows="100%,*" border="0" frameborder="0" framespacing="0" framecolor="#000000">

<FRAME src="<? echo("$newurl"); ?>" name="page" frameborder="0" framespacing="0" border="0">

<NOFRAMES>

<body bgcolor="#FFFFFF" >

<CENTER>

<BR>

<BR>

<A href="<? echo("$newurl"); ?>"><? echo("$title"); ?></A>

</CENTER>

</BODY>

</NOFRAMES>

</FRAMESET>

</HTML>

 

 

 

Being a newbie in the PHP world and use to html it worked for me!

 

Hope it helps someone... Toodles!

Link to comment
Share on other sites

That sort of redirect, although javascript, will get you just as heavily punished by search engines as an html meta tag refresh would. Many will even bar you from getting any listings at all.

 

If you're going to use a redirect then you need to use a 301 permanent redirect via .htaccess in the root of your web.

 

Vger

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...