Advertisement:

Author Topic: Guests can't see index.php?  (Read 409 times)

Offline anidea

  • Jr. Member
  • **
  • Posts: 254
Guests can't see index.php?
« on: August 25, 2019, 03:04:44 PM »
Hi, I was hoping someone might have an easy answer for this.  Our forum is mostly private, but I added an "index.php" page that describes the site, for people that are directed to the forum.  Apparently no one ever gets to see it, though, because if you're a guest, the only thing you see is the login page prompting you to make a username, or if you're a member, you go straight to the forum and have no need to go to the root page.

For some reason I don't recall this being always true, but it's true now, and I'd like to know how to change it (but now I'm so old I don't remember what I did before, or even if I did it right).  Is there some setting I need to use to make http://mysite.org/ default to http://mysite.org/index.php and also make it viewable to guests?

Thank you!

Offline Illori

  • Project Manager
  • SMF Legend
  • *
  • Posts: 51,127
Re: Guests can't see index.php?
« Reply #1 on: August 25, 2019, 03:15:02 PM »
link to your forum and the page in question? without seeing it we can guess all day on how to fix it, if we can see it we may be able to tell you exactly how to fix it.

Offline anidea

  • Jr. Member
  • **
  • Posts: 254
Re: Guests can't see index.php?
« Reply #2 on: August 25, 2019, 03:23:27 PM »
« Last Edit: August 25, 2019, 03:35:13 PM by anidea »

Offline GigaWatt

  • The Smiley Guy
  • Support Specialist
  • SMF Hero
  • *
  • Posts: 2,104
  • Gender: Male
    • Macedonian electronics forum
Re: Guests can't see index.php?
« Reply #3 on: August 25, 2019, 03:34:30 PM »
I believe this has something to do with your hosting account and/or the .htaccess file. This file also holds directives about which files to show and which files should be hidden when viewing the forum's root (or any other directory) from the web (http). Download the .htaccess file from the root of the forum, open it up with a text editor and see if it holds a line like this in it.

Code: [Select]
DirectoryIndex index.html index.htm index.php
If it does, comment out the line (put a # symbol in front of it), upload the modified .htaccess file to the forum's root and see if it properly redirects users to the index.php page when you type in http://yourdomain.tld/ (i.e. load http://yourdomain.tld/index.php).
« Last Edit: August 25, 2019, 03:51:04 PM by GigaWatt »
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

Offline anidea

  • Jr. Member
  • **
  • Posts: 254
Re: Guests can't see index.php?
« Reply #4 on: August 25, 2019, 03:40:14 PM »
Ah, this is starting to sound familiar.  So it's nothing to do with SMF permissions then?  I don't seem to have an .htaccess file at all, but I do recall having/making one in the past.

Sorry, I've had some brain injury issues in the past few, so some of this is fuzzy.  I really appreciate the help!

Offline anidea

  • Jr. Member
  • **
  • Posts: 254
Re: Guests can't see index.php?
« Reply #5 on: August 25, 2019, 03:45:50 PM »
So I created an .htaccess file, but nothing changed.  A registered member can see the index.php file just fine when going to the main page, but a guest only gets the page that allows them to sign up, even if I type in  http://mysite.org/index.php

Could there still be permissions issues relating to guests?

Offline Illori

  • Project Manager
  • SMF Legend
  • *
  • Posts: 51,127
Re: Guests can't see index.php?
« Reply #6 on: August 25, 2019, 03:51:48 PM »
how do you have it setup that if you go to http://cubaamor.org/ it shows your forum which is in http://www.cubaamor.org/smf/index.php ? how are you creating the index.php page you want shown? it is from SMF?

Offline anidea

  • Jr. Member
  • **
  • Posts: 254
Re: Guests can't see index.php?
« Reply #7 on: August 25, 2019, 03:55:24 PM »
I did this so long ago lol

index.php is located in the root.  At the top of index.php (and a few other custom pages sitting in the root) is the following:

//Path to SSI.php
require("/home/public/smf/SSI.php");

//Page title. This will appear in the browser
$context['page_title_html_safe'] = 'CubaAmor.org';

//This is self explanatory
template_header();


Offline GigaWatt

  • The Smiley Guy
  • Support Specialist
  • SMF Hero
  • *
  • Posts: 2,104
  • Gender: Male
    • Macedonian electronics forum
Re: Guests can't see index.php?
« Reply #8 on: August 25, 2019, 03:56:35 PM »
Hmmm... this is what I'm getting when I type in http://cubaamor.org.



As you can see, the Register button is right there.
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

Offline Illori

  • Project Manager
  • SMF Legend
  • *
  • Posts: 51,127
Re: Guests can't see index.php?
« Reply #9 on: August 25, 2019, 04:07:35 PM »
since you dont allow guests to view anything, after you include SSI.php it will always prompt for log in.

you would have to add code to allow guests to view something other then the log in box.

Offline anidea

  • Jr. Member
  • **
  • Posts: 254
Re: Guests can't see index.php?
« Reply #10 on: August 25, 2019, 05:27:35 PM »
Hmmm... this is what I'm getting when I type in http://cubaamor.org.


As you can see, the Register button is right there.

But I don't want the Register button, well I do want it, but I want people to see the main index page (http://cubaamor.org/index.php) which has a bunch of text describing what the site is about, above that.  Or below it, frankly, I'm not overly concerned with where, just that the stuff shows when non-registered guests to go the website the first time.

Offline anidea

  • Jr. Member
  • **
  • Posts: 254
Re: Guests can't see index.php?
« Reply #11 on: August 25, 2019, 05:32:53 PM »
since you dont allow guests to view anything, after you include SSI.php it will always prompt for log in.

you would have to add code to allow guests to view something other then the log in box.

I guess I'm asking what code to add to allow guests to view something other than the login box? 

I want them to view the login box, plus the stuff on index.php, which is what I thought it was supposed to do, but doesn't.

I just wanted a page that looks like the forum but is outside of the forum and therefore visible to guests.

Is there no way to do that, then?
« Last Edit: August 25, 2019, 05:43:36 PM by anidea »

Offline GigaWatt

  • The Smiley Guy
  • Support Specialist
  • SMF Hero
  • *
  • Posts: 2,104
  • Gender: Male
    • Macedonian electronics forum
Re: Guests can't see index.php?
« Reply #12 on: September 12, 2019, 10:11:29 AM »
Could you draw what you're trying to achieve... use screenshots and a simple image editor, like Paint :).
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 9,236
Re: Guests can't see index.php?
« Reply #13 on: September 12, 2019, 06:33:39 PM »
If you want to keep the login window and just add additional content to the page, you can put it in function template_kick_guest() in Login.template.php.