ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Can search be used with .htaccess rewrite?

October 18, 2010 5:59pm

Subscribe [3]
  • #1 / Oct 18, 2010 5:59pm

    Deelicious

    86 posts

    I have my EE website built with the index page named “index2.php”. Everything works fine except the search module, which I now realize does not function properly because my index.php page includes a php rewrite script for a specific function.

    Is it possible to configure the search module to function properly with these conditions?

  • #2 / Oct 19, 2010 5:18am

    John Henry Donovan

    12339 posts

    Deelicious,

    What version and build of EE are you using?
    Are you using any extensions?

    What exactly isn’t working with your search?
    What rewrites are you using?
    Can you give us some background as to why you have renamed the index.php?

  • #3 / Oct 20, 2010 12:03am

    Deelicious

    86 posts

    1.6.9, 20100415
    Extensions: FieldFrame, Low NoSpam, Simple Tags, Sitemap Pinger, Edit Tab AJAX, jQuery for the Control Panel

    This website just launched a mobile version of their website. They’re using a php script to detect whether a mobile device or computer is being used, then redirecting the user to the proper address. When using this redirect on the default page, the search box accepts the query term, then sends the user back to the homepage. I don’t really understand how the EE search functions, but I’ve found in the past that if the index or default page uses a redirect, it doesn’t function properly.

    So my question is can I use a device detect and redirect script on the homepage and still use the search properly on the rest of the site? I’m open to suggestions if you have a better suggestion.

    Thanks!

  • #4 / Oct 20, 2010 3:10pm

    Ingmar

    29245 posts

    I still don’t fully understand your setup. You have renamed EE’s index.php to index2.php? Everything should go through index2.php, then, how and where does index.php even come into play? Do you have a link where we can experience this for ourselves?

  • #5 / Oct 20, 2010 4:03pm

    Deelicious

    86 posts

    Ingmar, I had to modify the website back to it’s original form so the search would work properly so as it currently stands, it’s not performing as above. Let me see if I can explain my issue/goal in better detail.

    I am using a php redirect script on the index.php page so for example, when someone accesses example.com/index.php, the script checks to see if they are using a mobile device or a computer. If they are using a mobile device, it sends the user to their mobile website located at m.example.com. If they are using a computer, it forwards them to example.com/index2.php where the expression engine site home page is residing. Using the script I am using, I couldn’t have a computer user redirect to index.php because the script would keep redirecting and not stop. (For the record, I’m not a php expert, I’m using a generic script.) So I changed all the path’s and configuration files to have EE recognize index2.php as the main home page of the website. Everything works great doing this, except when I try to run a search, after submitting a keyword and pressing go, it sends me back to index.php, not index2.php. Of course when it does this, it then triggers the mobile detect/redirect, which then sends me to index2.php and never gives me search results.

    My goal is to get the search to not send me to index.php, but instead use index2.php if it needs it to populate the results. I hope this helps in understanding the issue. I appreciate your help.

  • #6 / Oct 21, 2010 3:27am

    John Henry Donovan

    12339 posts

    Deelicious,

    Have you set your no_result_page= and result_page= parameters?


    Good article here on setting up an alternative version of your website

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases