Comments (3)
@ComradePashka I've tried to add test cases for your problem but I couldn't really reproduce the issue. It would help if you could check the tests in 20b1083. You can also run them locally if you have phpunit installed. Just run phpunit
from the projects root directory.
If that's not an option, maybe you can come up with a simplified example config and a step by step instruction for how to reproduce the problem.
from yii2-localeurls.
@ComradePashka I've done some more tests with the following setup:
$config = [
'language' => 'en',
'components' => [
'urlManager' => [
'class' => 'codemix\localeurls\UrlManager',
'enablePrettyUrl' => true,
'showScriptName' => false,
'languages' => ['en','de'],
'rules' => [
'<slug:.+>' => 'site/index',
],
],
I've then tested different things:
- Open
/de/simpleslug
works - Open
/en/simpleslug
redirects to/simpleslug
- Open
/de/some/slug/url
works - Open
/en/some/slug/url
redirects to/some%2Fslug%2Furl
which gives a 404 from the webserver due to the%2F
in the URL
So the problem is with slugs, that contain slashes. But you can't really have slashes in slugs anyway. E.g. if you try to create a URL like this:
Url::to(['site/index', 'slug' => 'some/slug/url'])
You get /some%2Fslug%2Furl
which leads to a 404 again. This is the same that happens when we do the redirect for /en/some/slug/url
above.
So I'm not sure if there really is a valid bug. Any comments?
from yii2-localeurls.
@ComradePashka As there was no feedback I have to assume that the issue no longer exists. I'm closing this for now. Feel free to add a comment if you think there's still something to fix. An updated test case for the problem would be very helpful in that case.
from yii2-localeurls.
Related Issues (20)
- Problem with default language HOT 3
- Redirect from https to http HOT 1
- Ajax also redirects when enableLanguagePersistence is turned on HOT 2
- Regular expression trouble HOT 5
- Using GeoIp as primary language detection method HOT 2
- Support for different domains HOT 2
- The page keeps redirecting HOT 1
- index.php is shown in browser url HOT 1
- How can i change language position in url HOT 2
- Please fix this define HOT 3
- Url::to with rules HOT 1
- One language for all EU locales HOT 1
- Problem with change language under Windows HOT 3
- Some issues with yii2-localeurls
- using Yii functionality HOT 2
- Bug in tests HOT 1
- The configuration for the "localeUrls" component must contain a "class" element. HOT 1
- Generating URL with custom urlRule HOT 2
- Help me please. Error with route. HOT 3
- Redirect for specific languages HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yii2-localeurls.