Laravel Public Kaldırma

Merhabalar,

İlk önce ana klasördeki htaccess dosyasına aşağıdaki kodları yazıyoruz.

<code>Options -MultiViews -Indexes

RewriteEngine On

# Handle Authorization Header

RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]

RewriteCond %{REQUEST_URI} !(\.css|\.js|\.png|\.woff|\.woff2|\.jpg|\.svg|\.gif|robots\.txt)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_URI} !^/public/

RewriteRule ^(.*)$ public/$1 [L]</code>

Public içindeki .htaccess dosyasına;

<code>Options -MultiViews -Indexes

RewriteEngine On

# Handle Authorization Header

RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]

RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_URI} !^/public/

RewriteRule ^(css|js|images)/(.*)$ public/$1/$2 [L,NC]
</code>

Sonra ana dizinde server.php dosyasının adını index.php olarak değiştiriyoruz. Hepsi bu kadar.

Leave a Reply

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Next ArticleJson ile gelen veriyi Jquery ile İşleme