skip to Main Content

So for two days I can not understand why this won’t work…:

  Options -Indexes 
  Options +FollowSymLinks
  RewriteEngine On
  RewriteRule ^advice/([a-zA-Z]+)/([0-9]+)/$ advice.php?advice=$1&id=$2

Obviously .htaccess is allowed since I am not able to directory open folders, but why doesn’t the link work?



  1. Try turning off multiviews so the server doesn’t try and search for that as a file. In addition add the conditions so that it knows it’s not looking for a real file or directory it’s trying to serve and make the trailing slash optional.

      Options -Indexes +FollowSymLinks -MultiViews
      RewriteEngine On
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule ^advice/([a-zA-Z]+)/([0-9]+)/?$ /advice.php?advice=$1&id=$2 [L]
    Login or Signup to reply.
  2. Does your RewriteRule redirect to an existing file?
    Try this, it works for me

    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule . /test2/test.php
    • shows the location of the .htaccess file
    • is a direct link
    • opens the same test.php file using rewrite
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top