Step 1:
$nano /etc/apache2/apache2.conf
find <Directory /var/www/>
Rename AllowOverride None to AllowOverride All
save the file and run
$service apache2 restart
then run below commands on terminal
$a2enmod headers
$a2enmod rewrite
then restart server by running
$service apache2 restart
finally Replace .htaccess in project folder
DirectoryIndex index.html index.php
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Rewritecond $1 !^(index\.php|(.*)\.swf|forums|images|css|downloads|jquery|assets|public|Public|js|robots\.txt|favicon\.ico)
Rewritecond %{REQUEST_FILENAME} !-f
Rewritecond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php?$1 [L,QSA]
# hiding the directory listing
Options -Indexes
<FilesMatch "\.(jpg|jpeg|png|gif|swf)$">
Header set Cache-Control "max-age=604800, public"
</FilesMatch>
$nano /etc/apache2/apache2.conf
find <Directory /var/www/>
Rename AllowOverride None to AllowOverride All
save the file and run
$service apache2 restart
then run below commands on terminal
$a2enmod headers
$a2enmod rewrite
then restart server by running
$service apache2 restart
finally Replace .htaccess in project folder
DirectoryIndex index.html index.php
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Rewritecond $1 !^(index\.php|(.*)\.swf|forums|images|css|downloads|jquery|assets|public|Public|js|robots\.txt|favicon\.ico)
Rewritecond %{REQUEST_FILENAME} !-f
Rewritecond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php?$1 [L,QSA]
# hiding the directory listing
Options -Indexes
<FilesMatch "\.(jpg|jpeg|png|gif|swf)$">
Header set Cache-Control "max-age=604800, public"
</FilesMatch>
0 comments:
Post a Comment