0

is there are anything to do to delete index.php from output html? This is not very "clear"...

In my case its channel array and I call {{entry.url}}... Any idea how could be this fixed / avoid?

Big TNX for any idea!

3
  • 3
    There are many questions here about index.php in URLs... do any of those address your issue? craftcms.stackexchange.com/search?q=index.php
    – Lindsey D
    Jan 30 '17 at 23:36
  • Yes, Lindsey, I know that there is a lot questions about it and I red them almost all. My httacces looks working fine, but I find that the problem is that in output html the url is printed with index.php and for SEO it´s not very good (as well I saw that somebody had problem with Google Ananlytics) and it´s worry me a lot.
    – Irina
    Jan 31 '17 at 12:02
  • 1
    If your htaccess is working correctly, you won't see index.php output anywhere, including in your analytics. I'd suggest opening a new question with the htaccess you're using and what exactly you're seeing and where. Feb 7 '17 at 23:39
1

I'd suggest starting with the official docs on removing index.php from your URLS:

https://craftcms.com/support/remove-index.php

https://craftcms.com/support/why-index.php

And if that doesn't help, there are lots more environment-specific things here on Craft SE, you can check.

3
  • Thank you Brand. I already tried both and It's redirect, but in output HTML the link is with index.php between site and slug. This only happens on channel pages (news).
    – Irina
    Jan 31 '17 at 12:04
  • So you're saying you only get the index.php in the URL when you output it via {{ entry.url }}, but everywhere else, the index.php is being properly removed?
    – Brad Bell
    Jan 31 '17 at 18:20
  • Correct @BradBell. I get the index.php only in output html and this drive me a bit crazy... tnx
    – Irina
    Feb 6 '17 at 5:23
1

I had a case of this awhile back too. Craft will listen on whatever domain you point it to. If your site url (eg in Settings) doesn't actually resolve on the internet yet—or you have it pointed wrong—Craft will assume it doesn't actually work unless you tell otherwise. Drove me nuts for a couple hours one day until I retraced everything and realized I had the testing server URL still stuck in there.

In addition to what everyone else has written, I don't try to troubleshoot these kinds of issues using your regular web browser, use curl -I http://whatever to see what's happening.

2
  • Hi @RitterKnight, thank you for your reply. Do you mean that till I point DNSs it will print index.php in output HTML? This is doesnt sound logic, but thank you anyway for an idea, who knows... :) I will try to install just clear site on real domain and let you know if it solve the issue.
    – Irina
    Feb 6 '17 at 13:51
  • Let's say you have a testing server test.whatever.com. On the Internet, maybe the DNS hasn't caught up but you had put an entry in your local hosts file to push it out to production. I admit, probably not common but worth thinking about. Some developers don't worry about pointing servers until the site is actually off staging and that switch can take some time. Feb 6 '17 at 23:27

Not the answer you're looking for? Browse other questions tagged or ask your own question.