Problems, need help? Have a tip or advice? Post it here.
3 posts Page 1 of 1
Turning pretty urls on is breaking my search page and my archive pages. I am fairly confident I am using <cms:show k_site_link /> everywhere I should to get an absolute url to resources. However it seems like after rewriting the pretty url minus the part after the last '/' character is being used as site url. Weird, I am sure! I don't know web servers and url rewriting a lot, but I can show you what I mean:

Search without pretty urls from any page with searh form:

Code: Select all
http://bostonjerkcenter.com/search.php?x=0&y=0&s=jerk


Search with pretty urls turned on from the 'about.php' page:

Code: Select all
 http://bostonjerkcenter.com/about/search.php?x=0&y=0&s=jerk


Or, from the 'blog.php' page:

Code: Select all
http://bostonjerkcenter.com/blog/search.php?x=0&y=0&s=jerk


Or, from an archive page of the blog template:

Code: Select all
http://bostonjerkcenter.com/blog/2015/01/search.php?x=0&y=0&s=jerk


In all cases I end up with a 404 error, presumably because the resoruces or search.php file do not exist below the pretty url page, (e.g. 'about/'.)

All the other pretty url pages seem to just work. At least using apache, with nginx I have a similar problem to the above for the blog archive pages. It seems as if all the resources are similarly trying to use the pretty url as the root of the site, even though I have explicitly used k_site_link to create an explicit path to the resource. So, for example I will be trying to GET /about/js/jquery.easypiechart.min.js, instead of /js/jquery.easypiechart.min.js.
Your search form action is relative:
Code: Select all
<form action="search.php" method="get">
It is a best practice to use the cms:link tag whenever linking to a template:
Code: Select all
<form action="<cms:link 'search.php'/>" method="get">
cheesypoof wrote: Your search form action is relative:
Code: Select all
<form action="search.php" method="get">
It is a best practice to use the cms:link tag whenever linking to a template:
Code: Select all
<form action="<cms:link 'search.php'/>" method="get">


Doh! You're absolutely right. I changed all my "href="s and "src="s but forgot about my "action="s. :oops:

Many thanks cheesypoof for such a quick response and a great product! :)
3 posts Page 1 of 1