1

I recently setup Windows Subsystem Linux and created a symbolic link to a Windows folder in the Apache2 default server folder like so...

ln -s /mnt/c/Users/user/Desktop/folder /var/www/html

...so that I was left with the following folder and file structure

/var/www/html/folder/file.php
/var/www/html/folder/css/file-name.css

In the PHP file I had linked to the CSS file. However, the CSS filename included a dash (file-name.css), which prevented localhost/folder/file.php from displaying any changes made to file-name.css in the browser.

Anybody know why this happened?
Is this a bug?
Or are dashes not allowed in a Linux and or Apache environment?

  • dashes are most certainly allowed in paths. Can you show how you have linked the CSS file in your PHP file? Maybe something else is going on – Olle Kelderman Aug 18 '17 at 8:26
  • @OlleKelderman it was effectively detecting the CSS file, but the dash in its filename was causing conflict insofar as it wouldn't detect changes to the content of the CSS file. I used a standard link element. <link rel='stylesheet' href='file-name.css'> – BugWhisperer Aug 18 '17 at 22:33
  • sorry for late response, got suddenly busy with something and forgot about this. Anyway, so you're saying it worked once but as soon as you edit the css files it wont detect changes? In that case, I have no idea.... – Olle Kelderman Aug 22 '17 at 10:18
  • @OlleKelderman no, that's not at all what i was saying. the file was detected by the browser (i.e. some styling was implemented), but if you made changes to the CSS file none of them would be implemented. for instance, it detected the background color, but if you were to change the color of the background the change wouldn't show up. for whatever reason the dash caused some sort of conflict – BugWhisperer Aug 22 '17 at 19:58
  • huh, now I dont get it anymore. A file is detected or not, not partially ("some styling was implemented"). Unless you maybe have some syntax errors in those files. Can you show the complete content of both the PHP and CSS file? – Olle Kelderman Aug 22 '17 at 21:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.