Maybe I missed this in your video, but how to redirect a folder together with its content (files), so that I don't have to redirect each file separetly? My goal is to prevent typing a path to a folder or file that exists and seeing its source code in the browser.
I do a lot of projects to try to make it easier to learn more things. I have 2 htaccess videos on the channel. If they do not cover what you need to know, let me know how can I expand it to more videos but I covered pretty much everything I usually use.
The .htaccess file is a server directive file so it cannot be run from VS Code. You have to create the file and place it on an Apache server. Here is a link on how you can setup and enable .htaccess on your server: phoenixnap.com/kb/how-to-set-up-enable-htaccess-apache
I am farely new at this. What is the syntax to call a CSS file in Apache2 using Autoindex? I have tried a few things I have found online (my environment is Linux 22.04 LTS). I am familiar with normal html and css where there is a set html file, but this one seems to be auto generated on call.
Sorry, I am not following the question. My best guess answer would be to use "/thecssfolder/thecssfile.css". That will point it directly to the CSS file. If the filename is autogenerated, I would use something like Gulp to run a script that moves it to a predetermined folder and name once it is generated. If that is not possible, maybe using JS to get the file and add a reference to it once the site is loaded.
TIL that the .htaccess file is actually your firewall!
Informative. Thanks!
It can be. A lot of server directives can be put there and they are run prior to access to your server so it can be used that way.
Thank you! I moved a site from one place to another and my php was displaying, not rendering. I found you when figuring out why. I needed this!
I love to hear it. Glad it helped you finish the move.
Do you use any of the directives? I use most of these on every website I build, especially speed optimization. Let me know your fav.
nice. thanks for great guide
Glad it was helpful!
Maybe I missed this in your video, but how to redirect a folder together with its content (files), so that I don't have to redirect each file separetly? My goal is to prevent typing a path to a folder or file that exists and seeing its source code in the browser.
Any info on where i can learn about the syntax of the configurations
I would start with the Apache Software Foundation, they have docs for it here: httpd.apache.org/docs/2.4/
Will you continue with the course or not?
I do a lot of projects to try to make it easier to learn more things. I have 2 htaccess videos on the channel. If they do not cover what you need to know, let me know how can I expand it to more videos but I covered pretty much everything I usually use.
what extension are you using to run the .htaccess file? cant seem to get them to run on my vscode
The .htaccess file is a server directive file so it cannot be run from VS Code. You have to create the file and place it on an Apache server. Here is a link on how you can setup and enable .htaccess on your server: phoenixnap.com/kb/how-to-set-up-enable-htaccess-apache
@@DevDrawer thank you for the help!
No problem. Glad I could help
I am farely new at this. What is the syntax to call a CSS file in Apache2 using Autoindex? I have tried a few things I have found online (my environment is Linux 22.04 LTS). I am familiar with normal html and css where there is a set html file, but this one seems to be auto generated on call.
Sorry, I am not following the question. My best guess answer would be to use "/thecssfolder/thecssfile.css". That will point it directly to the CSS file. If the filename is autogenerated, I would use something like Gulp to run a script that moves it to a predetermined folder and name once it is generated.
If that is not possible, maybe using JS to get the file and add a reference to it once the site is loaded.