Giter Club home page Giter Club logo

Comments (7)

fnagel avatar fnagel commented on May 23, 2024 5

Redirect URLs without language prefix. Might be useful to document this somewhere:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/([a-z]{2})/(.*)$
RewriteRule ^(.*)$ /en/$1 [L,R=301]
RewriteRule ^$ /en/ [L,R=301]

from typo3-realurl.

fsuter avatar fsuter commented on May 23, 2024 3

Thanks for your answer. I actually found a way around this, which seems correct to me and doesn't imply any changes in RealURL (although it does mean a change of behaviour, as you mention). If I force the setting of the "L" GET variable using the following TypoScript:

config {
    defaultGetVars {
        L = 0
    }
}

all my links include the language segment in the default language.

from typo3-realurl.

lsascha avatar lsascha commented on May 23, 2024 2

Sorry to post here, but i have a bit of trouble with this.
I have it working that all links get the language part included, however they are still accessible without that part. And for google this means its duplicate content. Is there any way to disallow accessing it without the language part? Using Realurl 2.0

Thanks.

from typo3-realurl.

dmitryd avatar dmitryd commented on May 23, 2024

Thanks for the report!

I guess it can be related to the valueDefault use. Previous version of RealURL used separate caches for encoding and decoding. So your visitors could come to the site using /foo/bar but the proper generated link os /fr/foo/bar/. Due to different caches incoming and generated links could be different. Newer versions use the same cache, so if users come through /foor/bar, encoding will also return /foor/bar. On one hand such behavior helps to prevent duplicate content. On the other hand it is not consistent with previous behavior.

This is just an idea. I will investigate and see what can I do about it. Probably, I should change handling of valueDefault to a redirect but I am not sure yet.

Thanks a lot for testing and reporting!

from typo3-realurl.

dmitryd avatar dmitryd commented on May 23, 2024

Note for myself: needs documentation!

from typo3-realurl.

dmitryd avatar dmitryd commented on May 23, 2024

Documentation is done, closing the issue.

from typo3-realurl.

dmitryd avatar dmitryd commented on May 23, 2024

Is there any way to disallow accessing it without the language part?

Use rewrites (mod_rewrite for Apache or nginx rewrites). You can always check if language segment is included or not and 301-redirect accordingly.

from typo3-realurl.

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.