Jump to content

Non Latin letters in URLs


k07n
 Share

Recommended Posts

Hi!

Is where any way to throw 404 in urls like this: processwire.com/aboutпривет/sites/

In fact, it is just ignore Russian letters and render content without them. SEO crying =)

post-831-0-44825800-1404216179_thumb.png

Link to comment
Share on other sites

If you want to 404 that situation, add this to your .htaccess file, somewhere after "RewriteEngine On": 

# ----------------------------------------------------------------------------------------------- 
# Send URLs with non name-format characters to 404 page
# ----------------------------------------------------------------------------------------------- 
RewriteCond %{REQUEST_URI} "[^-_.a-zA-Z0-9/~]"
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?it=/http404/ [L,QSA]
  • Like 3
Link to comment
Share on other sites

share my nginx config part for this:

server {
  # all your stuff here

  error_page 404 /index.php?id=/http404/;

  # bla-bla-bla config

  # add this before location / {...}

  location ~ [^-_.a-zA-Z0-9/~] {
    try_files $uri $uri/ =404;
  }
}

working fine for me

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...