Skip to main content

Posts

Showing posts with the label htaccess

Most Useful .htaccess Tricks for WordPress website

Most Useful .htaccess Tricks for WordPress website Some most useful .htaccess tricks for your WordPress website are here. Wordpress needs htaccess to work perfectly and runs smoothly. Here is the htaccess code for a basic wordpress site: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress ----------- If you are using Localhost , for example: http://localhost/codingsparks Then htaccess is... # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / codingsparks/ RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /codingsparks /index.php [L] </IfModule> # END WordPress Wordpress MultiSite htaccess: RewriteEngine On RewriteBase / RewriteRu...

Remove public from Laravel using htaccess

Remove public from Laravel using htaccess RewriteEngine On # Remove all trailing slashes  RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} /(.*)/$ RewriteRule ^ /%1 [R=301,L] RewriteCond %{REQUEST_URI} !(\.css|\.js|\.png|\.jpg|\.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 ^(css|js|images)/(.*)$ public/$1/$2 [L,NC]