index.php running on website if Apple device used
Posted by: Dingus (---.20-3.cable.virginm.net)
Date: November 04, 2021 10:04PM

Hi folks.
I've downloaded the lates WAMP
I used WAMP to generate the new sites.

My issue is one of my sites stops at www and runs index.php, it doesn't goto the website root.
This only happens on iPhones or iPads. Seriously. I know how crazy it sounds, but I've checked muliple devices.
I have 2 sites. 1 works fine but 1 does as described.


my vhost file:

# Virtual hosts
#
<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>


#
<VirtualHost *:80>
ServerName photos
DocumentRoot "d:/wamp64/www/photos"
<Directory "d:/wamp64/www/photos/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>


#
<VirtualHost *:80>
ServerName scotlodge
DocumentRoot "d:/wamp64/www/scotlodge"
<Directory "d:/wamp64/www/scotlodge/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>

and my host file:

#
127.0.0.1 localhost
::1 localhost

127.0.0.1 photos
::1 photos

127.0.0.1 scotlodge
::1 scotlodge

All of it was generated by WAMP.

Options: ReplyQuote
Re: index.php running on website if Apple device used
Posted by: Otomatic (Moderator)
Date: November 05, 2021 10:05AM

Hi,

> one of my sites stops at www and runs index.php, it doesn't goto the website root.
In the httpd.conf file, there is the directive:
DirectoryIndex index.php index.php3 index.html index.htm
It is therefore quite normal that if an index.php file exists, it is executed if no other file is present in the url.
'http://mysite/' runs index.php
'http://mysite/myfile.php' runs myfile.php

------------------------------------------------------------------------------------------------------------
Wampserver 3.2.7 32 bit - Apache 2.4.51 - PHP 8.1.0…5.6.40 - MySQL 5.7.36 - MariaDB 10.5.13/10.6.5
Wampserver 3.2.7 64 bit - Apache 2.4.51 - PHP 8.1.0…5.6.40 - MySQL 5.7.36/8.0.27 - MariaDB 10.5.13/10.6.5
PhPMyadmin 5.1.1 - MysqlDumper 1.24.5
on W10 and W7 Pro 64 bit
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »

Options: ReplyQuote
Re: index.php running on website if Apple device used
Posted by: Dingus (---.20-3.cable.virginm.net)
Date: November 05, 2021 10:46PM

Thanks Otomatic for helping.
In my website directories I use index.html to run my sites.
The index.php is in WAMP's www folder not in my website folders.
I've removed the index.php from www folder to see if this helps.

Now I can access my websites but only using http and not https.
With https I get as far as www, which leads me to think WAMP is stopping access.

I get:
Forbidden

You don't have permission to access this resource.

The Apple side of things resolved itself over night. Weird.



Edited 3 time(s). Last edit at 11/05/2021 11:56PM by Dingus.

Options: ReplyQuote
Re: index.php running on website if Apple device used
Posted by: Otomatic (Moderator)
Date: November 06, 2021 09:34AM

Hi,

> Now I can access my websites but only using http and not https.
Secure SSL access is not just a matter of replacing http with https, that would be far too simple and a magic wand.

To be able to switch your local sites to https, see item 7 of Wampserver 3 - Some explanations

**** The VirtualHost localhost must remain with Require local

RiggsFolly has explained how to connect from a phone/tablet: see [forum.wampserver.com]

------------------------------------------------------------------------------------------------------------
Wampserver 3.2.7 32 bit - Apache 2.4.51 - PHP 8.1.0…5.6.40 - MySQL 5.7.36 - MariaDB 10.5.13/10.6.5
Wampserver 3.2.7 64 bit - Apache 2.4.51 - PHP 8.1.0…5.6.40 - MySQL 5.7.36/8.0.27 - MariaDB 10.5.13/10.6.5
PhPMyadmin 5.1.1 - MysqlDumper 1.24.5
on W10 and W7 Pro 64 bit
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »



Edited 1 time(s). Last edit at 11/06/2021 09:40AM by Otomatic.

Options: ReplyQuote
Re: index.php running on website if Apple device used
Posted by: Dingus (---.20-3.cable.virginm.net)
Date: November 06, 2021 11:50AM

Thanks again Otomatic.

I believed I'd setup WAMP to use SSL, perhaps not.

I'm trying to get WAMP working as it should before I move forward.

I don't know what changed things as I've been messing with settings and configs, but at least I now get past www.
Unfortunately what happens now is, no matter what site I try to access WAMP only runs the first entry in httpd-vhost.conf.
I've verisfied this by swapping what entry appears first.

What a saga. WAMP is good, but.

Perhaps a removal of WAMP including entries in the Registry and start again.

I won't be doing any further work on this for a week.



Edited 2 time(s). Last edit at 11/06/2021 01:59PM by Dingus.

Options: ReplyQuote
Re: index.php running on website if Apple device used
Posted by: Otomatic (Moderator)
Date: November 08, 2021 06:27PM

Hi,

> I believed I'd setup WAMP to use SSL, perhaps not.
Out of the box, Wampserver does not include the use of https.

> Perhaps a removal of WAMP including entries in the Registry and start again.
There is nothing in the registry about SSL and Wampserver.

------------------------------------------------------------------------------------------------------------
Wampserver 3.2.7 32 bit - Apache 2.4.51 - PHP 8.1.0…5.6.40 - MySQL 5.7.36 - MariaDB 10.5.13/10.6.5
Wampserver 3.2.7 64 bit - Apache 2.4.51 - PHP 8.1.0…5.6.40 - MySQL 5.7.36/8.0.27 - MariaDB 10.5.13/10.6.5
PhPMyadmin 5.1.1 - MysqlDumper 1.24.5
on W10 and W7 Pro 64 bit
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »

Options: ReplyQuote
Re: index.php running on website if Apple device used
Posted by: Dingus (---.20-3.cable.virginm.net)
Date: November 16, 2021 01:05PM

Thanks again Otomatic.
Sorry for the slow response, been away.

An update for you.
index.php no longer runs unless I omit the extension /*** ie. 127.0.0.1
Removed WAMP.
Deleted vhost and hosts.
Reinstalled WAMP.
Using WAMP's virtualhost management install. (So I know they are configered correctly.)

Now using either localhost or 127.0.0.1 with the correct extension /***** I get the correct website.
However, when I use an URL, DNS or IP, for either site I now get:

Forbidden

You don't have permission to access this resource.
Apache/2.4.46 (Win64) PHP/7.3.21 Server at 82.40.52.30 Port 80

Both sites have 'Require all granted'.

Options: ReplyQuote
Re: index.php running on website if Apple device used
Posted by: Otomatic (Moderator)
Date: November 16, 2021 04:25PM

Hi,

> index.php no longer runs unless I omit the extension /*** ie. 127.0.0.1

I'm sorry, but to understand the difference between the two, not only do I need concrete and real examples, but also what you mean by extension. Please say:
- if I type 'http://mysitexxx/' index.php runs.
- if I type 'http://mysiteyyy/' index.php doesn't run.

> Now using either localhost or 127.0.0.1 with the correct extension /***** I get the correct website.
> However, when I use an URL, DNS or IP, for either site I now get:

Same request as above and from where?

------------------------------------------------------------------------------------------------------------
Wampserver 3.2.7 32 bit - Apache 2.4.51 - PHP 8.1.0…5.6.40 - MySQL 5.7.36 - MariaDB 10.5.13/10.6.5
Wampserver 3.2.7 64 bit - Apache 2.4.51 - PHP 8.1.0…5.6.40 - MySQL 5.7.36/8.0.27 - MariaDB 10.5.13/10.6.5
PhPMyadmin 5.1.1 - MysqlDumper 1.24.5
on W10 and W7 Pro 64 bit
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »

Options: ReplyQuote
Re: index.php running on website if Apple device used
Posted by: Dingus (---.20-3.cable.virginm.net)
Date: November 16, 2021 05:37PM

Hello again Otomatic.
I used *** rather than typing each website.
Let me explain what my full setup is.

I have 2 domains with a hosting company.
These are forwarded to my IP address with the WAMP websites. For exaple 12.23.34.45/photos and 12.23.34.45/scotlodge (Both Fictitious IPs)


I don't use the index.php I use index.html in my site directories. (Hope this works ok)


If I type [mysite] (Which goes through my hosting domain) I get the forbiden message. (Both sites)
Or if I type my basic IP address I get the same 'Forbidden' result.

Only if I use a local address does either of my sites work.
localhost of 127.0.0.1 runs index.php in the www directory and this gives my the WAMPSERVER Homepage.
127.0.0.1/photos runs my photo site fine as does the 127.0.0.1/scotlodge one gives me my Lodge site.

It seems like WAMP is stopping access to any directory, including www, from outside.
As I'm getting 'Apache/2.4.46 (Win64) PHP/7.3.21 Server at 12.23.34.45 Port 80 I think it's at least reaching WAMP.

I disabled my Firewall to check it wasn't that, even though it didn't interfer before.

I'd get back to you quicker but I'm not getting email notifications.



Edited 2 time(s). Last edit at 11/16/2021 05:44PM by Dingus.

Options: ReplyQuote
Re: index.php running on website if Apple device used
Posted by: Dingus (---.20-3.cable.virginm.net)
Date: November 16, 2021 06:35PM

Hello again Otomatic.

I found a post you helped in from 2018 where you suggested moving </VirtualHost> up to close after DocumentRoot path.

This did the trick for me. I now can get URL access.

Thanks for all your help.

Options: ReplyQuote


Sorry, only registered users may post in this forum.