Search code examples
apachehttpd.confmod-alias

Apache php httpd-xampp.conf alias not working


I have httpd-xampp.conf with

<IfModule alias_module>
...
    Alias /examples "D:/xampp/htdocs/examples/" 
    <Directory "D:/xampp/htdocs/examples">
        Options Indexes FollowSymLinks Includes ExecCGI
    AllowOverride All
    Order allow,deny
    Allow from all
    Require all granted
    </Directory>
</IfModule>

an in examples folder i have index.html, but when i access http://localhost:8880/examples, i have error

This page was not found

You are not logged in.

Back Log in Issues

Is there any error of my config? other alias : phpmyadmin, security work well.


Solution

  • I change httpd-xampp.conf to

    <IfModule alias_module>
    ...
        #!!! Don't know why
        #Alias /examples "D:/xampp/examples/" don't work 
    
        Alias /my-examples "D:/xampp/examples/" 
        <Directory "D:/xampp/examples">
            AllowOverride AuthConfig
            Require all granted
        </Directory>
    </IfModule>
    
    #
    # New XAMPP security concept
    #
    <LocationMatch "^/(?i:(?:xampp|security|licenses|phpmyadmin|webalizer|server-status|server-info|my-examples))">
            Require local
        ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
    </LocationMatch>
    

    and http://localhost:8880/my-examples work now