Hello,

In the default .htaccess of symfony we have:

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]

  # 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>


I would like to redirect www.example.com/index.php to www.example.com
with a 301 redirection.

One solution would be to add the following rule in the htaccess:

  RewriteCond %{REQUEST_URI} index\.php [NC]
  RewriteRule ^index.php$ http://www.example.com/ [L,R=301]

But this rule makes a conflict with the rule :
RewriteRule ^(.*)$ index.php [QSA,L]

It provokes an infinite loop.

Another option would to rename the script index.php to another name
like frontend.php in the web folder.

But before to do that i want to make sure that there is no other way
to do this only by modifying the htaccess.

Does anybody have an idea ?

Thanks in advance for your help.

Mickael

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

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