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.

mydomain.com loading differently to mydomain.com/site/index

March 09, 2012 10:57pm

Subscribe [2]
  • #1 / Mar 09, 2012 10:57pm

    Stefani Ann

    35 posts

    When i type in mydomain.com the twitter feed javascript on the hompage does not load, but when i navigate to mydomain.com/site/index it loads fine - im confused as i thought these were the same page?

    Any suggestions?

    Do i need to do something in my htaccess?
    thanks!

  • #2 / Mar 11, 2012 12:37am

    Dan Decker

    7338 posts

    Hi stephanie23,

    I’ll do what I can to help you sort this out!

    Are you using .htaccess to remove index.php?

    Can you post the template code for us to take a look at?

    Cheers,

  • #3 / Mar 12, 2012 4:44am

    Stefani Ann

    35 posts

    Thanks - here is the code!
    htaccess:
    <pre><code>
    <Files .htaccess>
    order allow,deny
    deny from all
    </Files>
    Options -Indexes
    IndexIgnore *
    ErrorDocument 404 /index.php?/site/404
    RewriteCond %{HTTP_HOST} !^www\.
    RewriteRule ^(.*)$ http://www.%{http_host}/$1 [R=301,L]
    <IfModule mod_rewrite.c>
          RewriteEngine On
          # Removes index.php
          RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
          RewriteCond %{REQUEST_FILENAME} !-f
          RewriteCond %{REQUEST_FILENAME} !-d
          RewriteRule ^(.*)$ /index.php/$1 [L]
          # If 404s, “No Input File” or every URL returns the same thing
          # make it /index.php?/$1 above (add the question mark)
    </IfModule>
    <FilesMatch “\.(html|htm|php)$”>
      Header set imagetoolbar “no”
    </FilesMatch>
    <pre><code>
    I cant post the template it wont let me is says its too long…
    My javacscript is in my footer which is being pulled in by an embed.

  • #4 / Mar 12, 2012 4:55am

    Stefani Ann

    35 posts

    is mydomain.com supposed to redirect to mydomain.com/site/index? Because mine doesnt. This same page without the javacscript is loading when you type mydomain.com/site/wrongurl….. ive noticed the menu hover javascrupt is not loading either.

    thanks

  • #5 / Mar 12, 2012 4:59pm

    Dan Decker

    7338 posts

    Hi stephanie23,

    You can post your template code into a utility like Pastie and link it back here. Be sure to include your javascript that’s in the embed as well.

    is mydomain.com supposed to redirect to mydomain.com/site/index? Because mine doesnt. This same page without the javacscript is loading when you type mydomain.com/site/wrongurl….. ive noticed the menu hover javascrupt is not loading either.

    No, going to mydomain.com should load the template you have set as your site’s index template. That can be identified by looking Design->Template Manager and look for the group that has an asterisk by it.

    As far as the wrong URL, ExpressionEngine will default to displaying your homepage if you haven’t set a 404.

    Cheers,

  • #6 / Mar 14, 2012 11:24pm

    Stefani Ann

    35 posts

    http://pastie.org/3598292

    ive working out that the menu hover is due to conditionals, and the fact that mydomain.com is not loading mydomain.com/site/index despite being set to the homepage.

    When you say going to ” mydomain.com should load the template you have set as your site’s index template” do you mean it should actually change the url displayed in the browser?

    What is it thats loading then on the mydomain.com>? it looks exactly like mydomain.com/site/index, but without my twitter feed, and without having /site/index appended to the end of the url in the browser address window.

    I definitely have the index set as homepage with the little red asterisk.

  • #7 / Mar 15, 2012 12:23am

    Stefani Ann

    35 posts

    I fixed it!

    I added a conditional to my menu so the the current style applied to the home button on the navigation even when there was no second segment in the url. This has fixed both the menus and automagically the twitter feed…

    Any ideas why would this be?

  • #8 / Mar 16, 2012 2:45pm

    Shane Eckert

    7174 posts

    Hello Stefani,

    I am glad to hear it!

    I am not sure why this made it work, but it could have to do with the conditionals and the parse order.

    Is there anything else I can do for you?

    Cheers,

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

ExpressionEngine News!

#eecms, #events, #releases