Why is it redirected to index.php when I have a domain pointing to my computer?
Posted by: sylarlocke (---.ipcom.comunitel.net)
Date: September 27, 2023 12:51PM

Hello, I have my domain configured as follows:

<VirtualHost *:80>
ServerName mydomain.ddns.net
DocumentRoot "c:/wamp/www/project1"
    <Directory "c:/wamp/www/project1/">
        Options +Indexes +Includes +FollowSymLinks +MultiViews
        AllowOverride All
        Require all granted
    </Directory>
   <IfModule fcgid_module>
       Defines FCGIPHPVERSION "7.4.22"
       FcgidInitialEnv PHPRC ${PHPROOT}${FCGIPHPVERSION}
      <Files ~ "\.php$">
           Options +Indexes +Includes +FollowSymLinks +MultiViews +ExecCGI
           AddHandler fcgid-script .php
           FcgidWrapper "${PHPROOT}${FCGIPHPVERSION}/php-cgi.exe" .php
     </Files>
   </IfModule>
</VirtualHost>

In etc/host I have this:
192.168.2.110 mydomain.ddns.net

If I put in the browser:
mydomain.ddns.net

Redirects to wamp index.php home page

On the other hand, if I put the same thing on another computer, whether it is on the network or if it accesses from the Internet, it accesses the web correctly.

Do I have to put some alias or some configuration on the windows host?

Thank you



Edited 1 time(s). Last edit at 09/29/2023 10:41AM by RiggsFolly.

Options: ReplyQuote
Re: Why is it redirected to index.php when I have a domain pointing to my computer?
Posted by: sylarlocke (---.ipcom.comunitel.net)
Date: September 27, 2023 01:45PM

I have already solved the problem, it is strange because restarting wamp did not work, but if I right-click refresh, it updated correctly.

Thank you and forgive me.

Options: ReplyQuote
Re: Why is it redirected to index.php when I have a domain pointing to my computer?
Posted by: Otomatic (Moderator)
Date: September 27, 2023 02:03PM

Hi,

The automatic opening of the index.php file if no other file is specified in the url is a feature of virtually all sites managed by Apache, whether local or on the Internet.

If you type in 'https://www.wampserver.com/' or 'https://wampserver.aviatechno.net/' or 'https://www.apachelounge.com/', a page opens, but you haven't added anything to the url, and this page is the one generated by the index.php file.

This is done by the DirectoryIndex directive in httpd.conf

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote


Sorry, only registered users may post in this forum.