XMl Sitemap Generation adding a /

General ShopSite user discussion

XMl Sitemap Generation adding a /

Postby Feydakin » Tue Mar 03, 2009 8:22 am

I've built my site using a lot of subdirectories so my files names are things like /dogjewelry/Daisy_the_Dog_Waggles_Pendant_-_Gold_19675.php

When I publish the site and the sitemap is generated it gives me this -

http://www.animalcharms.net//dogjewelry ... _19675.php

Notice the double / in there?

I can fix it easily enough by doing a global search and replace on the xml file after it's created.. But I'd like to see if it can be forced to do it the right way..
Feydakin
 
Posts: 42
Joined: Wed Jul 23, 2008 11:24 am
Location: Indiana

Postby Jim » Tue Mar 03, 2009 9:01 am

Your problem is in the way you specify the file name "/dogjewelry/Daisy_the_Dog_Waggles_Pendant_-_Gold_19675.php"

All files published by ShopSite will be off of the url specified in the authorization file. By placing the / before your file name that would indicate that the file is in a root directory on the server and not based on the store's url. Simply remove the / from the front of your file names and it will work as it should.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Postby Feydakin » Tue Mar 03, 2009 10:01 am

But when I remove the / from the file name the whole site breaks down..

for example..

http://animalcharms.net/barnyardanimals/index.php

If I enter the file name /barnyardanimals/index.php everything sitewide works fine..

If I enter the file name as barnyardanimals/index.php then I end up with menu links that look like this http://animalcharms.net/dragonjewelry/b ... /index.php

So my issue is not being able to use subdirectories to keep things organized or manually editing the sitemap every time I publish or finding the spot in the sitemap creation code and removing the / it sticks on the end of the domain which would then break all of the pages that are in the root..

Looks like I'll be editing the sitemap :)
Feydakin
 
Posts: 42
Joined: Wed Jul 23, 2008 11:24 am
Location: Indiana

Postby loren_d_c » Tue Mar 03, 2009 10:43 am

It looks like you are using a custom page template that is a modified version of the Modern page template. Try editing that page template, and in the [-- DEFINE LINK_TO_PAGE --] section at the top, change the line that says:

<a href="[-- PAGE.FileName --]">

To instead say:

<a href="[-- OUTPUT_DIRECTORY_URL --]/[-- Page.FileName --]">

Then change your page filenames to not include the / at the beginning (it will be provided by the template), and then the links to pages in subdirectories will work on the pages generated by this template and in the sitemap file.

-Loren
loren_d_c
 
Posts: 2572
Joined: Fri Aug 04, 2006 12:02 pm
Location: Anywhere

Postby Feydakin » Tue Mar 03, 2009 7:40 pm

You rock Loren.. That solved the problem perfectly..
Feydakin
 
Posts: 42
Joined: Wed Jul 23, 2008 11:24 am
Location: Indiana


Return to User Forum

Who is online

Users browsing this forum: No registered users and 126 guests