Home New › Forums › Advance Topics/Customization › How to 301 redirect from one url to another url with full path?
- This topic has 4 replies, 1 voice, and was last updated 2 weeks, 3 days ago by
Admin.
-
-
<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>
<p>New url: <a href="https://www.new">https://www.newurl.com/path/?section=xyz</a></p>0 -
<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><IfModule mod_rewrite.c></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></IfModule></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>0 -
<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><IfModule mod_rewrite.c></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></IfModule></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>0 -
<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><IfModule mod_rewrite.c></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></IfModule></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>0 -
<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><IfModule mod_rewrite.c></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></IfModule></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>0
-
- You must be logged in to reply to this topic.
