Ecommerce software home
Shopping Cart Software Forum for Ecommerce Templates
 
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

Find us on Facebook Follow us on Twitter View our YouTube channel
Search our site
Author « Topic »  

JustDucky923
Ecommerce Template Guru

USA
1332 Posts

Posted - 02/06/2020 :  09:40:58  
I've recently converted an old Dreamweaver site to a new WordPress site. Most things are working well. I just noticed that the ECT search bar that I have in the header of every page does not work on every page. If I search from the home page, the search works fine. If I'm on any other page in the site, I get a "Page Not Found" error -- except the store pages themselves. I can search from the "Cart" page for instance.

I can see from URL when I try and search from one of the other WordPress pages that it is using the current name of the page and then adding the "search.php" -- for instance if I search from the "About Us" page - here is the URL: https://www.alkydigger.net/about-us/search.php

The search widget is placed into the header on the "Widgets" page using an ECT Search widget, using simple text, and showing on all pages.

Any ideas?

Vince
Administrator

42466 Posts

Posted - 02/15/2020 :  03:03:42  
Hi JustDucky923
I'm sorry if this got missed but if you look in the themename/header.php file for the <form> tag for that search, the action will probably be...
search.php
Can you change that to...
/search.php
and that should sort this out.

Vince

Click Here for Shopping Cart Software
Click Here to sign up for our newsletter
Click Here for the latest updater

JustDucky923
Ecommerce Template Guru

USA
1332 Posts

Posted - 02/18/2020 :  13:36:17  
I searched through the header.php file - but there is no mention of "search" at all. This is a custom theme and I've added the ECT search widget using a custom widget area in the header and then placing the ECT Search Widget in that place. Is there somewhere else I could look? Or maybe I'm not understanding your answer correctly.

Vince
Administrator

42466 Posts

Posted - 02/19/2020 :  01:00:34  
Well, how about another approach then, in the header.php just after the opening <head> tag add...
<?php echo '<base href="' . site_url('/') . '" />'; ?>

What is happening is that the pages sees a URL like
yoursite.com/about-us
...as a subdirectory so relative links to go
yoursite.com/about-us/relative-link
But the above code will indicate the correct location.

Vince

Click Here for Shopping Cart Software
Click Here to sign up for our newsletter
Click Here for the latest updater

JustDucky923
Ecommerce Template Guru

USA
1332 Posts

Posted - 02/19/2020 :  08:36:12  
That worked!

I'm curious why I had to add that line? I have dozens of WordPress sites and I've never encountered that problem before. Any explanation as to why?
  « Topic »  
Jump To:
Shopping Cart Software Forum for Ecommerce Templates © 2002-2022 ecommercetemplates.com
This page was generated in 0.02 seconds. Snitz Forums 2000