2

I am using this htaccess code, located in the directory development.local/web/, to redirect all of my paths to development.local/web/index.php file.

<IfModule mod_rewrite.c>
   RewriteEngine On
   RewriteBase /web
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteRule ^(.*)$ /index.php?url=$1 [QSA,L]
</IfModule>

right now, I have development.local/web/ as my base url. so all paths must redirect to development.local/web/index.php as of right now all urls will redirect properly except development.local/web/ which gives me a 503 Forbidden Error.

4
  • Why do you have RewriteBase /web? Commented Jul 9, 2014 at 20:07
  • Yes, all files for my project are stored in development.local/web/ Commented Jul 9, 2014 at 20:09
  • But there is no /web/ in your URI development.local/foo/bar. Is /web your DocumentRoot? Commented Jul 9, 2014 at 20:11
  • No, /web would be considered a subdirectory of development.local and contains the .htaccess file. Commented Jul 9, 2014 at 20:12

1 Answer 1

5

Most likely you don't have DirectoryIndex setup.

Keep this in your .htaccess:

DirectoryIndex index.php
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]
Sign up to request clarification or add additional context in comments.

1 Comment

Terrific troubleshooting—bull's eye on the first try, +1 :)

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.