impresspages / ImpressPages

ImpressPages is php framework with admin panel. Build functional website in one hour.
http://www.impresspages.org
Other
501 stars 175 forks source link

attempt to get php webserver working properly #847

Closed Remo closed 7 years ago

Remo commented 7 years ago

I started playing around with ImpressPages yesterday. At home I often use the PHP built-in webserver to get a first impression about new PHP projects as it's super quick and easy. At first I thought it works fine, but today I've realized that you are also routing images through PHP.

My first attempt to fix this by adding a router script didn't work, but at least I've received a 404 error. It turned out that $server['SCRIPT_NAME'] caused my baseUrl to be http://localhost:8000/file/2017/05/15/.

This PR seems to fix that, but please don't merge this, setting $baseUrl to '' feels pretty ugly to me, but I didn't want to fiddle around with $server['SCRIPT_NAME'] as this might break other environments. I try to avoid creating my own routing stuff as I've had a lot of bad experiences with it, but maybe someone is more experienced when working with server variables and different webservers.

maskas commented 7 years ago

I've changed the base of merge to 'develop'. Usually, all new work must go to develop until it is released officially.

Remo commented 7 years ago

Okay, will create PRs against develop in the future! Are you sure there isn't a better solution for this problem? Overriding $baseUrl for cli seems a bit hacky.