Showing posts with label htaccess. Show all posts
Showing posts with label htaccess. Show all posts

January 31, 2016

htaccess if site open with www and its redirect without www


- If you want to open your site with out www then just simple write 2 lines in you .htaccess file and upload it in your root server.

For example:

RewriteEngine on

RewriteCond %{HTTP_HOST} ^www.domainname.com [NC]

RewriteRule ^(.*)$ http://domainname.com/$1 [L,R=301]

Note: In above example replace your currect domainname. If you have SSL certificate then used https:// instead of http://.


- And if you want used force www on without www domain name,

- Then just below 2 lines in your .htaccess file and upload in your root server.

For example:

RewriteEngine on

RewriteCond %{HTTP_HOST} ^domainname.com [NC]

RewriteRule ^(.*)$ http://www.domainname.com/$1 [L,R=301,NC]

Note: In above example replace your currect domainname. If you have SSL certificate then used https:// instead of http://.

If you have any question related any .htaccess rules issue then please comment me here I will you to solved that.

Enjoy!

January 23, 2016

htaccess rule for redirect non www to www.


- You can define following two line just for redirect your non www to wwww, If anyone open your site without www like http://domainname.com then its automatically redirect to  http://www.domainname.com,

- See below example:

RewriteCond %{HTTP_HOST} ^example.com$
RewriteRule (.*) http://www.example.com/$1 [R=301,L]


Enjoy :)

The Future of Technology: Emerging Trends to Watch in 2025

Introduction As we navigate through 2025, the technological landscape continues to evolve at an unprecedented pace. Innovations that once se...