1

The rewrite is not working.

  • site/index.php/page works;
  • site/page - does not work;

I use symfony 1.4.

.htaccess standard:

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>
3
  • 4
    Please check these things: What is the output of sudo a2enmod rewrite? Do you have AllowOverride All in virtual host config (like it is in the docs)? Do you have no_script_name: true in the default app's (e.g. frontend) settings.yml? Commented Nov 11, 2012 at 15:09
  • @1ed: a2enmod rewrite gave me a "Enabling module rewrite". Then I restarted the server, and all went fine. Thanks ! Commented May 6, 2013 at 10:31
  • @1ed: for the answer to be accepted, you will have to ask user1659698. Here is an upvote, though :) Commented May 7, 2013 at 17:00

1 Answer 1

1

You have to enable mod_rewrite using sudo a2enmod rewrite, and then restart the server.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.