how to redirect domain without changing URL
hi, how i can redirect the domain without changing url, this EXP: site.com/post TO site.net/post
i search a lot, but i don't found this method
i need help.
thank you.
-
If you don't have SSH access you can edit the file through cPanel >> File Manager instead. 0 -
ok how i can write it 0 -
While we're happy to help with issues related to the cPanel software, I'm not able to provide coding examples through the Forums. 0 -
ok thank you for trying to help, I will see what I can do. 0 -
ok thank you for trying to help, I will see what I can do.
You own the server or just have a shared account on a server? On a properly configured cPanel servers mod_rewrite is already enabled, you just have to write proper code in ".htaccess" file located in "public_html" folder. If the file ".htaccess" does not exists, simply create it, you can do all this using " cPanel >> File Manager". There is a possibility that file ".htaccess" is not visible, you will have to enable view hidden files in File Manager settings.0 -
the problem is i don't know how i can write it,?? 0 -
If you can type & write here, you can do the same there too. Watch some videos on how to use cPanel File Manager. Ask your host to do it for you. Hire someone to do it. 0 -
ok 0 -
Here"s how you can redirect the domain without changing the URL step by step. -> Log into cPanel -> Open File Manager -> public_html -> .htaccess -> Now Right-click on .htaccess, Select Edit -> You will see a box in which click on the Edit button, shown in the Right downside corner. Suppose visitors visit abc.com, but you want the visitors to redirect to abc2.com without changing the URL. Then, you need to write the below-mentioned Line using the .htaccess file. RewriteEngineOn RewriteCond%{HTTP_HOST} ^example1.com RewriteRule ^(.*) example 2 understand " Interesting articles to read. Free tutorials and HOW-TOs [P] The first Line acknowledges the Apache to begin the rewrite module. The redirection from the source domain to the target domain is indicated on the Second Line. You can also write these lines in your .htacccess -> RewriteCond%{HTTP_HOST} ^example1.com RewriteRule ^(.*) example 2 understand " Interesting articles to read. Free tutorials and HOW-TOs [P] Besides, you can also redirect the IP address to another website. You need to add the following lines to the .htaccess file. RewriteCond%{HTTP_HOST} ^192.168.45.11 RewriteRule (.*) example 2 understand " Interesting articles to read. Free tutorials and HOW-TOs [R=301,L] Now that this redirect is complete, the server will show you the result. The L indicates the Last rule in the run. The R=301 indicates that the web server permanently sends a 301 to the requesting browser or search engine. 0
Please sign in to leave a comment.
Comments
11 comments