{"id":406,"date":"2018-09-25T19:58:52","date_gmt":"2018-09-25T19:58:52","guid":{"rendered":"https:\/\/www.rochen.com\/docs\/?post_type=ht_kb&#038;p=406"},"modified":"2021-04-28T20:50:04","modified_gmt":"2021-04-28T20:50:04","slug":"dynamic-redirects-htaccess","status":"publish","type":"ht_kb","link":"https:\/\/www.rochen.com\/docs\/documentation\/dynamic-redirects-htaccess\/","title":{"rendered":"Dynamic Redirects &#8211; .htaccess"},"content":{"rendered":"<p>These directives would be added to your .htaccess file, most likely at the start of this file.<\/p>\n<p>Do you have a number of\u00a0parked domains, but want them to all show the content of your main domain? The following directive may be suitable:<\/p>\n<p><code>RewriteEngine on<\/code><br \/>\n<code>RewriteCond %{HTTP_HOST} ^parkeddomain.com$ [OR]<\/code><br \/>\n<code>RewriteCond %{HTTP_HOST} ^parkeddomain-2.com$<\/code><br \/>\n<code>RewriteRule ^(.*)$ http:\/\/www.maindomain.com\/$1 [R=301]<\/code><\/p>\n<p>Sometimes the easiest route might be just to redirect everything to a particular URL. If so, you could try the following:<\/p>\n<p><code>RewriteEngine on<\/code><br \/>\n<code>RewriteCond %{HTTP_HOST} !^www.maindomain.com$<\/code><br \/>\n<code>RewriteRule ^(.*)$ http:\/\/www.maindomain.com\/$1 [R=301]<\/code><\/p>\n<h3>HTTPS Redirection<\/h3>\n<p>If you have your own SSL certificate already installed, the following directive will redirect all your traffic to the https:\/\/ version of your site:<\/p>\n<p><code>RewriteEngine On <\/code><br \/>\n<code>RewriteCond %{SERVER_PORT} 80 <\/code><br \/>\n<code>RewriteRule ^(.*)$ https:\/\/www.example.com\/$1 [R,L]<\/code><\/p>\n<p>You can also use the built in CPanel redirect manager, however please note that all this does is append directives to your .htaccess<\/p>\n<p>If you are unsure of using the above method, or need any further explanation, please open a technical support ticket so that we may assist.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>These directives would be added to your .htaccess file, most likely at the start of this file. Do you have a number of\u00a0parked domains, but want them to all show the content of your main domain? The following directive may be suitable: RewriteEngine on RewriteCond %{HTTP_HOST} ^parkeddomain.com$ [OR] RewriteCond %{HTTP_HOST}&#8230;<\/p>\n","protected":false},"author":2,"comment_status":"closed","ping_status":"closed","template":"","format":"standard","meta":{"footnotes":""},"ht-kb-category":[230],"ht-kb-tag":[242,244,243,245],"class_list":["post-406","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-general-use-and-troubleshooting","ht_kb_tag-htaccess","ht_kb_tag-dynamic-redirects","ht_kb_tag-https","ht_kb_tag-https-redirection"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Dynamic Redirects - .htaccess - Rochen Documentation<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.rochen.com\/docs\/documentation\/dynamic-redirects-htaccess\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Dynamic Redirects - .htaccess - Rochen Documentation\" \/>\n<meta property=\"og:description\" content=\"These directives would be added to your .htaccess file, most likely at the start of this file. Do you have a number of\u00a0parked domains, but want them to all show the content of your main domain? The following directive may be suitable: RewriteEngine on RewriteCond %{HTTP_HOST} ^parkeddomain.com$ [OR] RewriteCond %{HTTP_HOST}...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.rochen.com\/docs\/documentation\/dynamic-redirects-htaccess\/\" \/>\n<meta property=\"og:site_name\" content=\"Rochen Documentation\" \/>\n<meta property=\"article:modified_time\" content=\"2021-04-28T20:50:04+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.rochen.com\\\/docs\\\/documentation\\\/dynamic-redirects-htaccess\\\/\",\"url\":\"https:\\\/\\\/www.rochen.com\\\/docs\\\/documentation\\\/dynamic-redirects-htaccess\\\/\",\"name\":\"Dynamic Redirects - .htaccess - Rochen Documentation\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.rochen.com\\\/docs\\\/#website\"},\"datePublished\":\"2018-09-25T19:58:52+00:00\",\"dateModified\":\"2021-04-28T20:50:04+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.rochen.com\\\/docs\\\/documentation\\\/dynamic-redirects-htaccess\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.rochen.com\\\/docs\\\/documentation\\\/dynamic-redirects-htaccess\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.rochen.com\\\/docs\\\/documentation\\\/dynamic-redirects-htaccess\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.rochen.com\\\/docs\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Dynamic Redirects &#8211; .htaccess\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.rochen.com\\\/docs\\\/#website\",\"url\":\"https:\\\/\\\/www.rochen.com\\\/docs\\\/\",\"name\":\"Rochen Documentation\",\"description\":\"Official documentation for Rochen&#039;s web hosting services as well as helpful articles for CMS like WordPress, Joomla and Drupal.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.rochen.com\\\/docs\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Dynamic Redirects - .htaccess - Rochen Documentation","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.rochen.com\/docs\/documentation\/dynamic-redirects-htaccess\/","og_locale":"en_US","og_type":"article","og_title":"Dynamic Redirects - .htaccess - Rochen Documentation","og_description":"These directives would be added to your .htaccess file, most likely at the start of this file. Do you have a number of\u00a0parked domains, but want them to all show the content of your main domain? The following directive may be suitable: RewriteEngine on RewriteCond %{HTTP_HOST} ^parkeddomain.com$ [OR] RewriteCond %{HTTP_HOST}...","og_url":"https:\/\/www.rochen.com\/docs\/documentation\/dynamic-redirects-htaccess\/","og_site_name":"Rochen Documentation","article_modified_time":"2021-04-28T20:50:04+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.rochen.com\/docs\/documentation\/dynamic-redirects-htaccess\/","url":"https:\/\/www.rochen.com\/docs\/documentation\/dynamic-redirects-htaccess\/","name":"Dynamic Redirects - .htaccess - Rochen Documentation","isPartOf":{"@id":"https:\/\/www.rochen.com\/docs\/#website"},"datePublished":"2018-09-25T19:58:52+00:00","dateModified":"2021-04-28T20:50:04+00:00","breadcrumb":{"@id":"https:\/\/www.rochen.com\/docs\/documentation\/dynamic-redirects-htaccess\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.rochen.com\/docs\/documentation\/dynamic-redirects-htaccess\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.rochen.com\/docs\/documentation\/dynamic-redirects-htaccess\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.rochen.com\/docs\/"},{"@type":"ListItem","position":2,"name":"Dynamic Redirects &#8211; .htaccess"}]},{"@type":"WebSite","@id":"https:\/\/www.rochen.com\/docs\/#website","url":"https:\/\/www.rochen.com\/docs\/","name":"Rochen Documentation","description":"Official documentation for Rochen&#039;s web hosting services as well as helpful articles for CMS like WordPress, Joomla and Drupal.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.rochen.com\/docs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/www.rochen.com\/docs\/wp-json\/wp\/v2\/ht-kb\/406","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rochen.com\/docs\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/www.rochen.com\/docs\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.rochen.com\/docs\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rochen.com\/docs\/wp-json\/wp\/v2\/comments?post=406"}],"version-history":[{"count":1,"href":"https:\/\/www.rochen.com\/docs\/wp-json\/wp\/v2\/ht-kb\/406\/revisions"}],"predecessor-version":[{"id":1694,"href":"https:\/\/www.rochen.com\/docs\/wp-json\/wp\/v2\/ht-kb\/406\/revisions\/1694"}],"wp:attachment":[{"href":"https:\/\/www.rochen.com\/docs\/wp-json\/wp\/v2\/media?parent=406"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/www.rochen.com\/docs\/wp-json\/wp\/v2\/ht-kb-category?post=406"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/www.rochen.com\/docs\/wp-json\/wp\/v2\/ht-kb-tag?post=406"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}