Home > OS >  Why all the directories of my laravel application is indexed in google?
Why all the directories of my laravel application is indexed in google?

Time:01-22

My application is in Laravel Vue I'v hosted on Hostinger VPS ubuntu 20. when I type my site in Google like exptradies.com google showing all the directories as bellow image. enter image description here

This is my site config

<VirtualHost *:80>
   ServerName exptradies.com
   ServerAlias www.exptradies.com
   ServerAdmin [email protected]
   DocumentRoot /var/www/html/exptradies/public
   <Directory /var/www/html/exptradies>
        AllowOverride All
        Options  FollowSymlinks
        Require all granted
        ReWriteEngine On
   </Directory>
   ErrorLog ${APACHE_LOG_DIR}/error.log
   CustomLog ${APACHE_LOG_DIR}/access.log combined
RewriteEngine on
RewriteCond %{SERVER_NAME} =www.exptradies.com [OR]
RewriteCond %{SERVER_NAME} =exptradies.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

Does anyone know What I'm missing in the configuration.

for the ssl I use Letsencypt cerbot.

CodePudding user response:

Add public to your path in Directory and this probably will solve your problem

<Directory /var/www/html/exptradies/public>
        AllowOverride All
        Options  FollowSymlinks
        Require all granted
        ReWriteEngine On
   </Directory>

Don't forget to restart apache service

CodePudding user response:

Your web server is configured to show directory indexes. That shows a web page with a list of files for directory requests when the directory does not contain an index document. You can disable this by using

Options -Indexes

That can either go beneath AllowOverride All or in your .htaccess file.

After making the configuration change you will have to wait a couple weeks for Googlebot to recrawl those pages and stop indexing them.

  • Related