How to 301 redirect from one url to another url with full path?

Home New Forums Advance Topics/Customization How to 301 redirect from one url to another url with full path?

Viewing 4 reply threads
    • <p>I have moved my website from one url to another url. And now I want older url to redirect to new url with full path. <br />Example of how i want is as follows:</p>
      <p>Old url: <a href="https://www.oldurl.com/path/?section=xyz">https://www.oldurl.com/path/?section=xyz</a></p&gt;
      <p>New url: <a href="https://www.new">https://www.newurl.com/path/?section=xyz</a></p&gt;

    • <p>Hi,<br />There are 2 ways of doing this.</p>
      <p><strong>1</strong><br />Add the following code to your .htaccess file in cPanel</p>
      <p class="prebox"><em>Redirect 301 / <a href="https://example.com/">https://www.newurl.com/</a><br /><br /></em>Above code will redirect all of your pages from old url to <a href="https://www.newurl.com">https://www.newurl.com</a><br /><br /><strong>2</strong></p>
      <p class="prebox">Add the following code to your .htaccess file in cPanel</p>
      <p class="prebox"><em>&lt;IfModule mod_rewrite.c&gt;</em><br /><em>      RewriteEngine On</em><br /><em>      RewriteCond %{HTTP_HOST} ^oldurl<span class="code-highlight">.com</span>$ [OR]</em><br /><em>      RewriteCond %{HTTP_HOST} ^www.<span class="code-highlight">oldurl.com</span>$</em><br /><em>      RewriteRule (.*)$ https://www.newurl<span class="code-highlight">.com</span>/$1 [R=301,L]</em><br /><em>&lt;/IfModule&gt;</em><br /><br />Above redirect code will redirect all of your pages from older domain to new domain with full path. Hope this will help you.</p>

    • <p>Hi,<br />There are 2 ways of doing this.</p>
      <p><strong>1</strong><br />Add the following code to your .htaccess file in cPanel</p>
      <p class="prebox"><em>Redirect 301 / <a href="https://example.com/">https://www.newurl.com/</a><br /><br /></em>Above code will redirect all of your pages from old url to <a href="https://www.newurl.com">https://www.newurl.com</a><br /><br /><strong>2</strong></p>
      <p class="prebox">Add the following code to your .htaccess file in cPanel</p>
      <p class="prebox"><em>&lt;IfModule mod_rewrite.c&gt;</em><br /><em>      RewriteEngine On</em><br /><em>      RewriteCond %{HTTP_HOST} ^oldurl<span class="code-highlight">.com</span>$ [OR]</em><br /><em>      RewriteCond %{HTTP_HOST} ^www.<span class="code-highlight">oldurl.com</span>$</em><br /><em>      RewriteRule (.*)$ https://www.newurl<span class="code-highlight">.com</span>/$1 [R=301,L]</em><br /><em>&lt;/IfModule&gt;</em><br /><br />Above redirect code will redirect all of your pages from older domain to new domain with full path. Hope this will help you.</p>

    • <p>Hi,<br />There are 2 ways of doing this.</p>
      <p><strong>1</strong><br />Add the following code to your .htaccess file in cPanel</p>
      <p class="prebox"><em>Redirect 301 / <a href="https://example.com/">https://www.newurl.com/</a><br /><br /></em>Above code will redirect all of your pages from old url to <a href="https://www.newurl.com">https://www.newurl.com</a><br /><br /><strong>2</strong></p>
      <p class="prebox">Add the following code to your .htaccess file in cPanel</p>
      <p class="prebox"><em>&lt;IfModule mod_rewrite.c&gt;</em><br /><em>      RewriteEngine On</em><br /><em>      RewriteCond %{HTTP_HOST} ^oldurl<span class="code-highlight">.com</span>$ [OR]</em><br /><em>      RewriteCond %{HTTP_HOST} ^www.<span class="code-highlight">oldurl.com</span>$</em><br /><em>      RewriteRule (.*)$ https://www.newurl<span class="code-highlight">.com</span>/$1 [R=301,L]</em><br /><em>&lt;/IfModule&gt;</em><br /><br />Above redirect code will redirect all of your pages from older domain to new domain with full path. Hope this will help you.</p>

    • <p>Hi,<br />There are 2 ways of doing this.</p>
      <p><strong>1</strong><br />Add the following code to your .htaccess file in cPanel</p>
      <p class="prebox"><em>Redirect 301 / <a href="https://example.com/">https://www.newurl.com/</a><br /><br /></em>Above code will redirect all of your pages from old url to <a href="https://www.newurl.com">https://www.newurl.com</a><br /><br /><strong>2</strong></p>
      <p class="prebox">Add the following code to your .htaccess file in cPanel</p>
      <p class="prebox"><em>&lt;IfModule mod_rewrite.c&gt;</em><br /><em>      RewriteEngine On</em><br /><em>      RewriteCond %{HTTP_HOST} ^oldurl<span class="code-highlight">.com</span>$ [OR]</em><br /><em>      RewriteCond %{HTTP_HOST} ^www.<span class="code-highlight">oldurl.com</span>$</em><br /><em>      RewriteRule (.*)$ https://www.newurl<span class="code-highlight">.com</span>/$1 [R=301,L]</em><br /><em>&lt;/IfModule&gt;</em><br /><br />Above redirect code will redirect all of your pages from older domain to new domain with full path. Hope this will help you.</p>

Viewing 4 reply threads
  • You must be logged in to reply to this topic.