Create an .htaccess file containing the following line:
Options -Indexes
That is one option. Another option is editing your apache configuration file.
In order to do so, you first need to open it with the command:
vim /etc/httpd/conf/httpd.conf
Then find the line: Options Indexes FollowSymLinks
Change that line to: Options FollowSymLinks
Lastly save and exit the file, and restart apache server with this command:
sudo service httpd restart
(You have a guide with screenshots here.)
Related Posts:
- How can I use an .htaccess file in Nginx?
- .htaccess redirect http to https
- htaccess – Redirect to subfolder without changing browser URL
- Https to http redirect using htaccess
- .htaccess: Invalid command ‘RewriteEngine’, perhaps misspelled or defined by a module not included in the server configuration
- WordPress multisite causing Error 101 (net::ERR_CONNECTION_RESET): Unknown error [duplicate]
- 404 Not Found The requested URL was not found on this server
- What is the difference between Local Server and a Web Server?
- How to run php files on my computer
- Whats the point of running Laravel with the command ‘php artisan serve’?
- Localhost is not working
- PHP $_SERVER[‘HTTP_HOST’] vs. $_SERVER[‘SERVER_NAME’], am I understanding the man pages correctly?
- Redirect vs RedirectMatch
- How to automatically redirect HTTP to HTTPS on Apache servers?
- SVN Error E175002 while checking out code from repository
- XAMPP, Apache – Error: Apache shutdown unexpectedly
- Enable PHP Apache2
- client denied by server configuration
- What is HTTPD exactly?
- XAMPP: Connecting to localhost fix? [Persistent]
- Request exceeded the limit of 10 internal redirects due to probable configuration error
- How do you redirect HTTPS to HTTP?
- Adding a user on .htpasswd
- a2enmod command not found in apache server using cpanel in linux vps
- Apache and Node.js on the Same Server
- Apache is downloading php files instead of displaying them
- lbmethod_heartbeat:notice – No slotmem from mod_heartmonitor –error after installing apache2.4.2 [closed]
- Difference between Systemctl and service command
- “End of script output before headers” error in Apache
- XAMPP installation on Win 8.1 with UAC Warning
- org.apache.jasper.JasperException
- Site does not exist error for a2ensite
- Getting a 500 Internal Server Error on Laravel 5+ Ubuntu 14.04
- How to remove index.php from WordPress site URL
- WAMP won’t turn green. And the VCRUNTIME140.dll error
- PHP code is not being executed, but the code shows in the browser source code
- Redirect old php link to wordpress link in .htaccess
- Redirect old php link to wordpress link in .htaccess
- Cant login to wp-admin (redirecting to homepage), But CAN login to wp-login.php
- Cant login to wp-admin (redirecting to homepage), But CAN login to wp-login.php
- Use subdomain for certain urls
- Multisite htaccess on localhost with WP as an SVN external?
- How do I get the right permissions for WordPress running Apache on Debian
- How can I improve site/page performance of WordPress websites?
- WordPress Multisite – Multiple subfolders for blogs
- WordPress in sub directory wp-admin problem
- Rewrite /?rest_route=/ link to /wp-json/ without changing default permalink structure in apache
- index.php not loading in main folder of wordpress
- Error 101 after upgrading WordPress
- Best practices for making a WordPress site “movable”?
- WordPress V2 REST-API: Endpoints 404?
- How to configure self hosted wordpress so that everything can be upgraded/installed from dashboard
- Installing WordPress in a Sub-Folder (not in root) on Localhost
- What’s the proper way to setup WP-CLI on Ubuntu so that I don’t have to use the flag –allow-root?
- Which Apache-modules must I enable?
- Does WP Have a Function To Generate .htaccess RewriteCond?
- What are some good Apache settings to use with wordpress?
- .htaccess 301 vs. 302 Enforcing HTTPS
- Redirect from different port to subdomain – htaccess
- 404 with post name permalinks
- WordPress 404 on Subdomain
- Only expose routes with prefix /wp-json on WordPress using Apache
- Rule to redirect non logged in User to Custom Registration/login Page in .htaccess file
- .htaccess file missing from WordPress install directory
- What’s the opposite of required valid user in .htaccess authentication
- How to redirect http://mydomain/blog/blahblah/ to http://mydomain/blahblah/ in wordpress htaccess?
- How can i redirect one url to another url using .htaccess or add_rewrite_rule
- Override htacces rule only for specific directory
- Restrict uploaded files into a custom folder to logged in users by htaccess: looking for Nginx – not only Apache – solution
- How do I test to ensure that my wp-config file is protected?
- Site loads very slowly (4-5 minute load time)
- How do I host WordPress on a hidden domain through a reverse proxy?
- .htaccess Security Header Rules
- Apache Fallback instead of add_rewrite_rule
- mod_rewrite loop, redirecting http to https on certain section of wordpress blog
- .htaccess in subdir gets ignored by WordPress’ own .htaccess in /
- Directing subdomain to main domain and keeping the subdomain format with .htaccess
- Point root folder to blog.domain.com and subdirectory to domain.com possible?
- WordPress – Promoting A Dev Build In A Subdirectory To Production / Root Directory
- Page preview is shown, updating page gives 404 error
- how to combine wordpress htaccess on my root domain + php on subfolder
- 301-redirect directives for blogger to wordpress migration
- Redirect old domain with query paramaters
- Does WP suppresses .htaccess if permalinks are disabled?
- Detect CURLOPT_SSL_VERIFYPEER programatically?
- Redirect – remove custom query string
- Internal Server Error apache
- How do I do a redirect to WordPress permalink with post id via htaccess?
- How to redirect only 404 pages with htaccess in WordPress
- What to do when WordPress posts on a new server return an error 404
- Accidentally messed up URLs
- Show wordpress locally in xammp and in iPhone via ip
- Moving wordpress to different url/server creates redirect loop
- WordPress docker with empty responses to HTTP requests
- White Screen of Death for unknown reason but fixes after rebooting the server
- fix 302 redirection error on https
- how to prefer static page if it exists over wordpress page
- Forbidden You don’t have permission to access this resource. Apache/2.4.41 (Ubuntu) Server [closed]
- Access sub-domain when root public_html is protected with .htaccess password
- WordPress page not accessible through WAN [closed]