DevGroup-ru / dotplant2

E-Commerce CMS - Yii Framework 2 (yii2, shop)
http://dotplant.ru/
Other
641 stars 252 forks source link

Static pages #271

Closed sotavant closed 8 years ago

sotavant commented 8 years ago

if site work on some port. Example http://localhost:3030 Static pages(route /page/page/show) gives response 404. Problem in method app\modules\page\components\PageRule::parseRequest (line 43). $request->serverName is equal localhost, but Yii::$app->getModule('core')->serverName is equal localhost:3030. If in config set serverName with value 'localhost', assets don't can load

ivansal commented 8 years ago

Have you tried to set serverName "localhost:3030"?

sotavant commented 8 years ago

Yes, the property Yii::$app->getModule('core')->serverName is equal "localhost:3030", because i'm set this value in config files: grep -R 'serverName' ./config ./config/common-local.php: 'serverName' => 'localhost:3030' if, this value "localhost", assets can't load screen shot 2015-12-19 at 23 49 18

for testing i'm write this string: $serverName = "localhost:3030"; //if ($request->serverName == Yii::$app->getModule('core')->serverName) { if ($serverName == Yii::$app->getModule('core')->serverName) { $_path = $request->getPathInfo(); } else { $_path = $request->absoluteUrl; }

this solution fix the problem with 404 response

Philosoft commented 8 years ago

@HannibalLecktor could you test this branch with yours setup please?

sotavant commented 8 years ago

yes, i can

sotavant commented 8 years ago

A new installation from branch feature/response-port is success) static pages and assets load correct

Philosoft commented 8 years ago

@HannibalLecktor fixed in pr #272