{"id":186,"date":"2019-06-22T09:44:15","date_gmt":"2019-06-22T09:44:15","guid":{"rendered":"https:\/\/smppcenter.com\/kb\/?p=186"},"modified":"2019-06-22T09:44:16","modified_gmt":"2019-06-22T09:44:16","slug":"htaccess-forcing-non-www-or-www","status":"publish","type":"post","link":"https:\/\/smppcenter.com\/kb\/htaccess-forcing-non-www-or-www\/","title":{"rendered":"Htaccess &#8211; Forcing Non-WWW or WWW"},"content":{"rendered":"\n<p>Are you looking to force your SMPP Center&#8217;s application hosted website with Non-WWW or WWW? The following trick help you achieve the goal.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Forcing Non-WWW to WWW<\/h2>\n\n\n\n<p>If you are looking to force all your users who uses http:\/\/example.com to http:\/\/www.example.com then follow the snippet.<\/p>\n\n\n\n<p>If you have hosted SMPP Center application on the root directory and using it on main domain, then paste the following code after <strong>RewriteBase \/<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>RewriteCond %{HTTP_HOST} ^www.(.*)$ [NC] RewriteRule ^(.*)$ http:\/\/%1\/$1 [R=301,L]<\/code><\/pre>\n\n\n\n<p>If you are planning to install SMPP Center <g class=\"gr_ gr_49 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace\" id=\"49\" data-gr-id=\"49\">applicattion<\/g> in your <g class=\"gr_ gr_4 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del\" id=\"4\" data-gr-id=\"4\">sub folder<\/g> then paste the following code after <strong>RewriteBase \/<\/strong> but replace <strong>demo<\/strong> with your subfolder name.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>RewriteCond %{HTTP_HOST} ^www.(.*)$ [NC] RewriteRule ^(.*)$ http:\/\/%1\/demo\/$1 [R=301,L]<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Forcing WWW to Non-WWW<\/h2>\n\n\n\n<p>If you are looking to force all your users who use http:\/\/www.example.com to http:\/\/example.com then follow the snippet.<\/p>\n\n\n\n<p>If you are hoping to install the SMPP Center application in your root folder then paste the following code after <strong>RewriteBase \/<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>RewriteCond %{HTTP_HOST} !^www. RewriteRule ^(.*)$ http:\/\/www.%{HTTP_HOST}\/$1 [R=301,L]<\/code><\/pre>\n\n\n\n<p>If you are hoping to install the SMPP Center application in your subfolder then paste the following code after <strong>RewriteBase \/<\/strong> but replace <strong>demo<\/strong> with your subfolder name.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>RewriteCond %{HTTP_HOST} !^www. RewriteRule ^(.*)$ http:\/\/www.%{HTTP_HOST}\/demo\/$1 [R=301,L]<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Are you looking to force your SMPP Center&#8217;s application hosted website with Non-WWW or WWW? The following trick help you achieve the goal. Forcing Non-WWW to WWW If you are looking to force all your users who uses http:\/\/example.com to http:\/\/www.example.com then follow the snippet. If you have hosted SMPP Center application on the root [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[71,151,87],"class_list":["post-186","post","type-post","status-publish","format-standard","hentry","category-general","tag-smpp-center","tag-smpp-center-application","tag-smpp-software"],"_links":{"self":[{"href":"https:\/\/smppcenter.com\/kb\/wp-json\/wp\/v2\/posts\/186","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/smppcenter.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/smppcenter.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/smppcenter.com\/kb\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/smppcenter.com\/kb\/wp-json\/wp\/v2\/comments?post=186"}],"version-history":[{"count":0,"href":"https:\/\/smppcenter.com\/kb\/wp-json\/wp\/v2\/posts\/186\/revisions"}],"wp:attachment":[{"href":"https:\/\/smppcenter.com\/kb\/wp-json\/wp\/v2\/media?parent=186"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/smppcenter.com\/kb\/wp-json\/wp\/v2\/categories?post=186"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/smppcenter.com\/kb\/wp-json\/wp\/v2\/tags?post=186"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}