htaccess redirect for non-www both http and https

Try this rule: RewriteCond %{HTTP_HOST} ^[^.]+\.[^.]+$ RewriteCond %{HTTPS}s ^on(s)| RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301] Here’s an explanation: The first condition tests if the HTTP header field Host has the required format (contains exactly one period). The second condition tests if the concatenated value of the value of the HTTPS variable (values on and off) and s … Read more

How can I create custom SEO-friendly URLs in OpenCart?

It turns out this can be done with a relatively simple change to a single file. No .htaccess rewrite rules, simply patch the catalog/controller/common/seo_url.php file and add your pretty URLs to an existing database table. The patch to seo_url.php: Index: catalog/controller/common/seo_url.php =================================================================== — catalog/controller/common/seo_url.php (old) +++ catalog/controller/common/seo_url.php (new) @@ -48,7 +42,12 @@ $this->request->get[‘route’] = ‘product/manufacturer/product’; … Read more

How can I create custom SEO-friendly URLs in OpenCart?

It turns out this can be done with a relatively simple change to a single file. No .htaccess rewrite rules, simply patch the catalog/controller/common/seo_url.php file and add your pretty URLs to an existing database table. The patch to seo_url.php: Index: catalog/controller/common/seo_url.php =================================================================== — catalog/controller/common/seo_url.php (old) +++ catalog/controller/common/seo_url.php (new) @@ -48,7 +42,12 @@ $this->request->get[‘route’] = ‘product/manufacturer/product’; … Read more

.htaccess – Redirect subdomain to folder

Add this to your .htaccess in your web root / directory RewriteEngine on RewriteBase / RewriteCond %{HTTP_HOST} ^m\.daltonempire\.nl$ [NC] RewriteCond %{REQUEST_URI} !^/m(/|$) [NC] RewriteCond %{REQUEST_FILENAME} !-d # not a dir RewriteCond %{REQUEST_FILENAME} !-f # not a file RewriteRule ^(.*)$ m/$1 [L] The %{REQUEST_FILENAME} conditions would let you access /exists.php and not rewrite it to /m/exists.php. … Read more

How Can I Remove “public/index.php” in the Laravel Url generated? [duplicate]

Option 1: Use .htaccess If it isn’t already there, create an .htaccess file in the Laravel root directory. Create a .htaccess file your Laravel root directory if it does not exists already. (Normally it is under your public_html folder) Edit the .htaccess file so that it contains the following code: <IfModule mod_rewrite.c> RewriteEngine On RewriteRule … Read more

Avoid public folder of laravel and open directly the root in web server

Let’s assume you have this folder structure in your server .cpanel/ public_html/ public_ftp/ .. And the laravel folder structure is app/ bootstrap/ public/ vendor/ composer.json artisan .. You can create a folder name mylaravelsite on your server inline with public_html and public_ftp folder, and copy to it the whole laravel application except the public folder … Read more