You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "@lbutlr" <kr...@kreme.com> on 2018/02/23 01:32:52 UTC

[users@httpd] Re: How to browse to index.php OR index.html on WordPress site?

On 2018-02-22 (15:38 MST), Kent West <we...@acu.edu> wrote:
> 
> But I still need to manually be able to get to the full-blown .php-based site. When I web-browse to sitename/index.php, it reroutes to sitename/index.html. If I change the .conf file to "DirectoryIndex index.html index.php" and restart Apache2, that doesn't help.


I have, in http.conf:

<IfModule dir_module>
    DirectoryIndex index.php index.html 
</IfModule>

Which loads index.php by default if it's present, otherwise index.html

Neither 'redirects' to the other.

I've never used a site.conf in this way, but I have overridden the default in a site conf:

DirectoryIndex index.htm

for example.

Wordpress has a pretty complicated .htaccess file, did you check there?

-- 
"I've just learned about his illness. Let's hope it's nothing trivial."
Irvin S. Cobb


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Re: How to browse to index.php OR index.html on WordPress site?

Posted by Kent West <we...@acu.edu>.
On Thu, Feb 22, 2018 at 11:14 PM, @lbutlr <kr...@kreme.com> wrote:

> On 22 Feb 2018, at 20:52, Kent West <we...@acu.edu> wrote:
> > On Thu, Feb 22, 2018 at 7:32 PM, @lbutlr <kr...@kreme.com> wrote:
> >
> > If I'm understanding you, this is not what I want; both index.html and
> index.php exist. I just need a means of picking either via URL.
>
> Which I am able to do. In fact, something has to specifically tell apache
> to NOT load a file that is specified by a full path. DirectoryInde only
> affects what loads the you laid a path ending in /
>

Okay, I added those three lines to my
/etc/apache2/sites-enabled/sitename.conf file:

 .
 .
 .
                DirectoryIndex index.html
#              DirectoryIndex index.php
                AllowOverride None
                Require all granted
        </Directory>

        <IfModule dir_module>
            DirectoryIndex index.php index.html
        </IfModule>

        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
 .
 .
 .

and restarted Apache2.

Now when I browse to sitename.org, I get the index.html file, and when I
browse to sitename.org/index.php, I still get the index.html file. So
nothing has changed.

I'm still doing something wrong?



> >> Wordpress has a pretty complicated .htaccess file, did you check there?
> >
> > No; it's my understanding that anything I can do in an .htaccess file I
> can do in the main global config files, that they're mostly just for
> overrides to those global config files, so I've just focused on the main
> global config files.
>
> The global config files will not override index.html to index.php, but the
> .htaccess might.
>
> Googling for a wordpress .htaccess I see the default config contains MANY
> rewriting conditions.
>
> <IfModule mod_rewrite.c>
> RewriteCond %{REQUEST_FILENAME} !-f
> RewriteCond %{REQUEST_FILENAME} !-d
> RewriteCond %{HTTP_HOST} !^webdav
> RewriteRule . /index.php [L]
> </IfModule>
>
>
I'd be happy to go the .htaccess route, but at this point, I don't have a
clue as to where to begin with this information you've provided. I think
you've only demonstrated that .htaccess has complexity, not that you've
demonstrated the specific complexity I'm needing to reach my goal?

Thanks!


-- 
Kent West                    <")))><
Westing Peacefully - http://kentwest.blogspot.com

[users@httpd] Re: How to browse to index.php OR index.html on WordPress site?

Posted by "@lbutlr" <kr...@kreme.com>.
On 22 Feb 2018, at 20:52, Kent West <we...@acu.edu> wrote:
> On Thu, Feb 22, 2018 at 7:32 PM, @lbutlr <kr...@kreme.com> wrote:
> 
> If I'm understanding you, this is not what I want; both index.html and index.php exist. I just need a means of picking either via URL.

Which I am able to do. In fact, something has to specifically tell apache to NOT load a file that is specified by a full path. DirectoryInde only affects what loads the you laid a path ending in /

>> Wordpress has a pretty complicated .htaccess file, did you check there?
> 
> No; it's my understanding that anything I can do in an .htaccess file I can do in the main global config files, that they're mostly just for overrides to those global config files, so I've just focused on the main global config files.

The global config files will not override index.html to index.php, but the .htaccess might.

Googling for a wordpress .htaccess I see the default config contains MANY rewriting conditions.

<IfModule mod_rewrite.c>
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{HTTP_HOST} !^webdav
RewriteRule . /index.php [L]
</IfModule>


-- 
Today the road all runners come/Shoulder high we bring you home. And
set you at your threshold down/Townsman of a stiller town.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Re: How to browse to index.php OR index.html on WordPress site?

Posted by Kent West <we...@acu.edu>.
On Thu, Feb 22, 2018 at 7:32 PM, @lbutlr <kr...@kreme.com> wrote:

> On 2018-02-22 (15:38 MST), Kent West <we...@acu.edu> wrote:
> >
> > But I still need to manually be able to get to the full-blown .php-based
> site. When I web-browse to sitename/index.php, it reroutes to
> sitename/index.html. If I change the .conf file to "DirectoryIndex
> index.html index.php" and restart Apache2, that doesn't help.
>
>
> I have, in http.conf:
>
> <IfModule dir_module>
>     DirectoryIndex index.php index.html
> </IfModule>
>
> Which loads index.php by default if it's present, otherwise index.html
>

If I'm understanding you, this is not what I want; both index.html and
index.php exist. I just need a means of picking either via URL.


>
> Neither 'redirects' to the other.
>
> I've never used a site.conf in this way, but I have overridden the default
> in a site conf:
>
> DirectoryIndex index.htm
>
> for example.
>
> Wordpress has a pretty complicated .htaccess file, did you check there?
>


No; it's my understanding that anything I can do in an .htaccess file I can
do in the main global config files, that they're mostly just for overrides
to those global config files, so I've just focused on the main global
config files.

But if .htaccess will solve my problem, I'm happy to go that route.

Thanks, though!

-- 
Kent West                    <")))><
Westing Peacefully - http://kentwest.blogspot.com