How to Remove the Trailing Slash from a URL
The trailing slash (also known as the slash that you see at the end of URL links) creates a common problem when optimizing websites for duplicate content. For instance, while elieandmai.com and elieandmail.com/ will both link to the same webpage, search engines will still divide link authority over the links, which means that the website will receive far less value.
In order to remove the trailing slash, you’ll have to implement a 301 redirection to the page with the trailing slash. This can be done with a few lines of code in the .htaccess file allowing you to redirect all incoming traffic without a trailing slash to the same URL.
This can be done with a few lines of code in the .htaccess file allowing you to redirect all incoming traffic without a trailing slash to the same URL.
If you decide to redirect all pages with a trailing slash to an URL without trailing slash, the following code will do this for you:
Explanation of this add trailing slash .htaccess rewrite rule
The first line tells Magento that this is code for the rewrite engine of the mod_rewrite module of Magento.
The 2nd line sets the current directory as page root.
You must be logged in to post a comment.