0

This is my .htaccess file for Symfony PHP framework project:

  RewriteEngine On

  RewriteBase /

  RewriteCond %{REQUEST_URI} \..+$
  RewriteCond %{REQUEST_URI} !\.html$
  RewriteRule (.*) - [L]

  RewriteCond %{HTTP_HOST} ^domena.pl
  RewriteRule (.*) www.domena.pl/$1 [R=301,L]

  RewriteRule ^index\.php ./ [R=301,L]

  RewriteRule ^(.*)$ index.php [QSA,L]

The one before last line not working at all. Any idea why?

1
  • Can you please explain exactly what the problem is. Apr 6, 2013 at 0:01

1 Answer 1

0

If you're just after requests for domain.com/index.php to be rewritten to domain.com/ then try it without the fullstop

RewriteRule ^index\.php / [R=301,L]

http://httpd.apache.org/docs/current/mod/mod_rewrite.html

Syntax: RewriteRule Pattern Substitution [flags]

The Substitution of a rewrite rule is the string that replaces the original URL-path that was matched by Pattern. The Substitution may be a:

  • file-system path
  • URL-path
  • Absolute URL
  • (dash)
1
  • There is no difference :(
    – Piotr
    Apr 5, 2013 at 19:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .