Using .htaccess files: common usage and an example
HTML-код
- Опубликовано: 26 авг 2024
- Access the full course ➤ davehollingwor...
Part of the course "Set up a localhost Web Server for Faster Website Development".
Common usage of .htaccess files to configure the Apache web server and a working example.
Sites shown in the video:
css-tricks.com...
github.com/pha...
Omg where have you been all my life, bro? Amazing dude. So subscribed right now!!
very very very useful, thanks aloooot
Very clear and useful. Thank you.
Thanks for the video! When would you choose to use a .htaccess file over configuring via the VirtualHost configuration? I guess the former is configurable at a directory level, whereas the latter is configurable only at the VirtualHost level?
If you have access to the config files, it's faster to put any configuration settings in there if possible. .htaccess files are useful when you don't have access to these, or you prefer to have the config settings in your codebase.
@@dave-hollingworth thanks Dave!
If I want to add a canonical tag to a PDF, do I add the code to the .htaccess file. If so, where inside the .htaccess file or does it not matter? thanks.
Never tried it, but there's a link here: www.inmotionhosting.com/support/website/how-to-canonicalize-images-and-pdfs-with-the-htaccess-file/
The github link requires a membership. It is not a direct link to a public resource. However the CSS-tricks link is public and helpful. Please place any links you mention in the description section of your video for sake of your viewers. Thanks.
Good call, I've added the links. The GitHub link is public though, it doesn't require membership to view it.
@@dave-hollingworth Ok I must have done something wrong. I thought I coppied the link and it took me to github and told me to log in or create an account. I will try it again.
good my like
Computer s