Remove Trailing Slash from WordPress URL? (The site also don't have www)
-
I need help as I am confused a lot with .htaccess Some months back, I removed WWW from the URL of my domain name using following .htaccess lines: RewriteCond %{HTTP_HOST} !^example.com$ [NC] RewriteRule ^(.*)$ http://example.com/%241 [L,R=301] Now, I also want to remove the trailing slash from the URL, as because I am using WordPress and a page/post will open, no matter if there's a trailing slash or NOT! I request you to please provide me the .htaccess code, so that I can REMOVE the trailing slash. Kindly remember, I don't want WWW also and I have already set .htaccess rule for the removal of WWW Note: 3 Years back when I started the blog, I set the Permalinks Structure without trailing slash. Now, suddenly Google Webmasters Tools is showing warnings. Also, the URL for rel="canonical" is WITHOUT trailing slash If you require any more details, I will be happy to provide
-
Answer:
Add the following code to the .htaccess. If there are any issues let me know by posting here. #get rid of trailing slashes RewriteCond %{HTTP_HOST} ^(www.)?turbocelica\.lv$ [NC] RewriteRule ^(.+)/$ http://www.example.com/%241 [R=301,L]
Pali Madra at Quora Visit the source
Related Q & A:
- How to remove extension and force trailing slash with .htaccess?Best solution by Stack Overflow
- How to pass parameter in wordpress url?Best solution by Stack Overflow
- Would someone at the underground stations lose their jobs if we don't drop litter?Best solution by Yahoo! Answers
- Why does the Easter bunny carry eggs? Rabbits don't lay eggs.?Best solution by Yahoo! Answers
- Why don't I get the little envelope in my taskbar in Outlook Express when I get a message?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.