You are here:  » Going Live - Correct use of subdirectories

Support Forum



Going Live - Correct use of subdirectories

Submitted by Alastair on Thu, 2008-02-07 15:16 in

Hello All

I installed Price Tapestry into a subdirectory "PT". I set up $config_baseHREF to reflect this. All works fine if I access the site via www.mydomain.com/pt

Soon I want to put the site into live operation by (I guess) moving index.php to the root directory.

I note that some of the urls in the code don't mention $config_baseHREF and just say things like if (file_exists("html/user_header_before.php")) require("html/user_header_before.php");

I had to put "/pt" before a lot or urls for links and images in order to get it to find them correctly.

I want to end up with one set of code that works whichever directory I choose to locate it on my server and for vistors to go to www.mydomain.com

I'm sure this is a very basic question but would appreciate any guidance.

Thanks in anticipation

Alastair

Submitted by support on Thu, 2008-02-07 15:35

Hi Alastair,

The reason some of the links etc. don't have the base prefix is because they are creating what are called "Relative URLs", and the whole point of this is that you can just move the code around and it will work in any directory on your site.

To move PT up to your top level directory, it should just be case of changing $config_baseHREF in config.php back to "/", and also the RewriteBase value in .htaccess if you are using search engine friendly URLs.

Finally, anywhere that you have manually added /pt/ infront of graphics etc. if you rework these to relative URLs they should work in any directory. However, you have to consider what that effective current directory is going to be if using search engine friendly URLs, which is why it is sometimes better to use the $config_baseHREF variable.

Cheers,
David.

Submitted by Alastair on Thu, 2008-02-07 17:19

Hi David

I don't necessarily want to move PT, I just want people to be able to access it from an index page in the root directory (i.e. without having to enter www.mydomain.com/pt )

or... would it just be simpler to move it!

Submitted by support on Thu, 2008-02-07 17:39

Hi Alastair,

Ah - I understand.

In that case, yes it's no problem really. The easiest thing to do is to copy the search form HTML from the main Price Tapestry index page, and then paste that into the main home page - that should be all you need to do, as the search form uses $config_baseHREF already, so the HTML you copy (between and including the FORM tags) will submit to the correct URL!

Cheers,
David.

Submitted by Alastair on Thu, 2008-02-07 22:44

Thank you