Access is denied at the url containing the colon, ":", on apache windows

I can’t open the url with ":" inside the url in my localhost for example, I can not open http://bolehnonton.dev/Halo-4:-Forward-Unto-Dawn (this is in my local host). results page in my browser

Access is denied!

You do not have permission to access the requested object. It is either read-only or not readable by the server.

If you think this is a server error, contact the webmaster. Error 403 bolehnonton.dev
Apache / 2.4.16 (Win32) OpenSSL / 1.0.1p PHP / 5.6.12

but I can open a similar URL with my hosting, http://bolehnonton.com/Halo-4:-Forward-Unto-Dawn

although the htaccess file is similar for both.

here is my vhost setup on my xampp

<VirtualHost *:80>
 ServerAdmin webmaster@bolehnonton.dev
   DocumentRoot "C:/xampp/htdocs/bolehnonton.com"
   ServerName bolehnonton.dev 
   <Directory C:/xampp/htdocs/bolehnonton.com>
    Allow from all
     Require all granted
        Options Indexes
  </Directory>
</VirtualHost>
+5
source share
2 answers

This is an Apache bug on Windows, declared as WONTFIX in 2009. I fixed it in libapr-1.dll, function test_safe_namein srclib\apr\file_io\win32\filestat.cto return ERROR_FILE_NOT_FOUNDfor colon names.

if (*name == '?' || *name == '*')
    return APR_EPATHWILD;
else
    return (*name == ':') ? APR_FROM_OS_ERROR(ERROR_FILE_NOT_FOUND) : APR_EBADPATH; // was: APR_EBADPATH;

I could have avoided recompiling Apache and fixed the binary.

+1
source

I just ran into the same problem with a colon in a URL. I paginated, and the page number in the URL was given after the colon.

The solution for my situation was to replace the colon with another character for developing the environment (my Windows computer) and leave the colon for production (a Linux computer).

, - .

0

Source: https://habr.com/ru/post/1614400/


All Articles