Re: How to browse to index.php OR index.html on WordPress site?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Thu, Feb 22, 2018 at 7:40 PM, Eric Covener <covener@xxxxxxxxx> wrote:
On Thu, Feb 22, 2018 at 5:38 PM, Kent West <westk@xxxxxxx> wrote:
> I have a WordPress site that works. If my
> /etc/apache2/sites-enabled/sitename.conf file is set with the
> "DirectoryIndex index.php" directive, all is well, and pointing a
> web-browser to http://sitename.org loads the sitename's index.php file as it
> should.
>
> But I need to temporarily put up a dummy site, consisting of just a very
> simply index.html file. That's easy enough; I create the index.html file,
> and then change the sitename.conf file to "DirectoryIndex index.html" and
> restart Apache2. All is good.
>
> 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.
>
> It seems I can serve index.html OR index.php, but not both at the same time
> (depending on the URL entered into the web-browser's URL bar).
>
> Bonus points after getting this to work: Adding a button in the "index.html"
> file that allows the viewer to "Click here to get to Full Site" that points
> to "index.php".
>
> I've been googling all morning and part of last night to figure this out,
> with no joy. Thanks for any help you can throw my way!

one idea:

<virtualhost *:80>
...
DirectoryIndex index.html index.php
</virtualhost>

# Access via an ssh tunnel.
<virtualhost  127.0.0.1:80>
...
DirectoryIndex index.php
</virtualhost>


I'm not understanding how to make this work. I added:

<virtualhost  127.0.0.1:80>
DirectoryIndex index.php
</virtualhost>

to the bottom of my sitename.conf file, and successfully restarted Apache2, but I can't figure out what to do from there.


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

[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux