Hi my friends, Long time no work. "Htacess" and forgot everything. How do I force all pages of a site to have www at the beginning and / in the end. example: site.com/page1 to www.site.com/page1/ www.site.com/page to www.site.com/page1/ Thanks
The www part is RewriteCond %{HTTP_HOST} ^site.com[nc] RewriteRule ^(.*)$ http://www.site.com/$1 [r=301,nc] I think RedirectMatch 301 (.*) //$1 should take care of the file-to-directory redirect.
Thanks for the help, but unfortunately it did not work. The first code only redirects the homepage. The second adds two bars on all the URLS.
Here's the one I use: RewriteEngine On RewriteCond %{HTTP_HOST} ^www\.domain\.com [NC] RewriteRule .? http://domain.com%{REQUEST_URI} [L,R=301] Code (markup):