Hi!

I was now looking for a solution for two days. And it's hard to find a
working one. Finally I found it and to make it easier for next one
looking for a solution, I will post it here:

  RewriteRule ^(.+)/$ http://%{HTTP_HOST}/$1 [R=301,L]

This line added into the .htaccess removes the trailing slash from the
requested url and redirects the the browser with a http 301(permanenly
moved) to the new url. So it's even search engine friendly(no
dublicates).

My .htaccess looks now this:

Options +FollowSymLinks +ExecCGI

<IfModule mod_rewrite.c>
  RewriteEngine On

  # uncomment the following line, if you are having trouble
  # getting no_script_name to work
  #RewriteBase /

  # we skip all files with .something
  #RewriteCond %{REQUEST_URI} \..+$
  #RewriteCond %{REQUEST_URI} !\.html$
  #RewriteRule .* - [L]

  RewriteRule ^(.+)/$ http://%{HTTP_HOST}/$1 [R=301,L]

  # we check if the .html version is here (caching)
  RewriteRule ^$ index.html [QSA]
  RewriteRule ^([^.]+)$ $1.html [QSA]
  RewriteCond %{REQUEST_FILENAME} !-f

  # no, so we redirect to our front web controller
  RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>


Found here:
http://www.cakephp.nu/quick-tip-generic-nonwww-www-vice-versa-301-redirect-htaccess

best regards,

Michael

http://www.kineticarm.com
http://www.dikeytus.com
http://www.lueftenegger.at

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to