All URLs are redirected to index.php

142 Views Asked by At

I have setup a Symphony framework on my localhost using this tutorial. I am using the PHP default server and MySQL. The frontend URL is working fine but when I go to the admin URL (http://localhost:8000/symdemo/admin), then my CSS URL is also redirected to the admin page meaning I am not getting CSS code into the response.

The reason as that the default PHP server does not have a URL-rewriting module and index.php is also adding to the CSS path.

How can I fix this?

1

There are 1 best solutions below

1
David Oliver On

I'm not 100% sure, but I think you'll find that using a webserver that supports rewrites is quicker than trying to replicate the necessary rewrites in PHP. Rewrites are listed as a requirement in Symphony CMS's readme, and last time I checked Symphony was still dependent on webserver rewrites for some of its routing/files.

You can, of course, use Apache. If you'd like to use a lighter and cleaner webserver that's easy to configure, I recommend Hiawatha, which has a Symphony URL toolkit/rewrite rule set available.