Code Monkey home page Code Monkey logo

Comments (4)

xepozz avatar xepozz commented on July 23, 2024 1

Try to set YII_ENV=/, but in .env, not .env.example file
https://github.com/yiisoft/demo/blob/master/blog/.env.example#L1

from demo.

rossaddison avatar rossaddison commented on July 23, 2024 1

This is working:

image

with .env

YII_ENV=
YII_DEBUG=true
SENTRY_DSN=
BASE_URL=

The BASE_URL had /blog in it which I removed.

Thanks!

from demo.

rossaddison avatar rossaddison commented on July 23, 2024

I have manually added a /blog to the browser url and this calls up the index page. I suspect this is a .htaccess issue as I have tried to edit the baseUrl parameter in the config/params.php without success.

from demo.

rossaddison avatar rossaddison commented on July 23, 2024

File Location: C:\wamp64\www\demo\blog\vendor\yiisoft\yii-middleware\src\SubFolder.php

if (!str_starts_with($path, $baseUrl)) {
                throw new BadUriPrefixException('URI prefix doesn\'t match.');
            }

Substituting the $path and the $baseUrl parameters in the throw's string yields:

$path = '/'        (path is the haystack)
$baseUrl = '/blog'   (baseUrl is the needle)

So the needle is definitely not in the haystack.

So the path clearly needs to be built up to '/blog' or the baseUrl needs to be reduced to / for them both to match.

The error message says ' Make sure that path from the web address contains the specified prefix'.
Substituting $this->prefix in the throw's message gives '/blog'.

So the path clearly needs to be built upto '/blog'. So where can we add '/blog' to the prefix?

from demo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.