How Do You Use .Htaccess To Create Search Engine Friendly Urls?
In this article, we will look at how you can use .htaccess to create search-engine-friendly URLs. We will use .htaccess to preserve your search engine rankings when moving your site to a new domain. We will also map dynamic pages to a static address, which search engines can better index. Log in to your server and change to the directory where your Apache server stores its HTML documents. This is usually called “htdocs”. Create the file .htaccess by typing the command: “touch .htaccess”. Don’t forget the period in front of the file name. Open the .htaccess file in your favorite text editor so that you can add new lines to the file. To preserve search engine rankings when moving a page, add the following line to .htaccess: “redirect 301 oldpage.html http://mynewsite.com/newpage.html”. This allows you to send users navigating to “oldpage.html” to your new site. Redirect your entire web site to a new domain name or provider by adding the following line to “.htaccess: redirect 301 / http:/