Problems, need help? Have a tip or advice? Post it here.
4 posts Page 1 of 1
Deal all, I wonder if someone has an idea concerning the pretty URLs architecture:

I am finishing a website furbished with the cool Couch CMS (admin backend, galleries, blog section). I have pretty URLs set up on a testing site (mytestingdomain.xx/folder/), all the relevant links prefixed with the "<cms:show k_site_link />", so far so good, everything looks fine. Now, there is a phpmailer script processing a product configurator form (I was not able to do the styling with the Couch native form the way I wanted it plus some other custom features), which fails to work with the pretty URLs on.

The trouble seems to be that there is a javascript (<script src="<cms:show k_site_link />form/js/jquery.form.js"></script>), which contains a reference to another script (url : '/form/mailer/owner.php' ,). With the pretty URLs activated, this link within the .js seems to lose its target. It works as expected if I use the full path (url : 'http://www.mytestingdomain.xx/folder/form/mailer/owner.php' ,) but not with the relative path.

The full path to the ,php file obviously is something I can live with so it is no big issue, I will also do some ore more tinkering with the RewriteBase in .htaccess and the site path in the config.php to look for the right combination or test it in a root folder directly ... but a solution may be helpful for more grave cases, so if there was a quck hint you can give from the top of your heads...

Thanks and Regards

Okay, SOLVED. I tested the whole thing in a domain root with define( 'K_SITE_URL', 'http://www.domain.xx/' ); in the config.php and RewriteBase / in the .htaccess, only had to add a "/" before the reference in my javascript. Wonderful script.

To that matter, could someone please drop a sententence or two about the actual practical difference between the "/" and "<cms:show k_site_link />"? I see the first creates a relative link href="/style.css", while the other an absolute link href="http://www.domain.xx/style.css" ... so is it only a matter of a safer approach to the site root? It would seem to me more reasonable to use the relative path only (i.e. the slash) so that I keep the http request within the same domain...
Slash means a site's root. On some servers it could be a filesystem's root, like /var/www/public_html/website. k_site_link on the other hand is defined in config.php, which allows to quickly place the site in a subfolder, transfer between local and production server without link isues etc.
You do not need to append k_site_link to all the links - just use <base> tag. viewtopic.php?f=4&t=10436&p=25789#p25788
Yep, that`s what I thought, tha ks. That initial issue was obviously caused by incorrectly defined site root (as I had the thing in a subfolder). Sitting in a root directly makes these thing a lot easier.
4 posts Page 1 of 1

Who is online

In total there are 4 users online :: 0 registered, 0 hidden and 4 guests
(based on users active over the past 5 minutes)

Users browsing this forum: No registered users and 4 guests