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?

oldboy
  • 383
  • 2
  • 5
  • 19
  • 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 08: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'> – oldboy 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 – oldboy 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
  • @OlleKelderman it's detected and partially implemented, yet if you make any changes none of them will show up. oh, man, i fixed the issue by simply removing the dash in the file name – oldboy Aug 22 '17 at 21:10
  • im soo confused right now :( – Olle Kelderman Aug 22 '17 at 21:11
  • @OlleKelderman breathe! 3 deep breaths. then read the posts again lol. try recreating the problem. just create a simple, barebones php file that uses a <link> to a css file with a dash in its name and then host the files on your server – oldboy Aug 22 '17 at 21:11

0 Answers0