Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I18N + News Manager = htaccess RewriteRules?
#2
I also got to this situation today.

I set up custom permalink structure, which is
Code:
%language%/%parent%/%slug%/

My previous .htaccess file looked like this (Fancy URLs on even in the News Manager)
Code:
RewriteEngine on

# Usually RewriteBase is just '/', but
# replace it with your subdirectory path
RewriteBase /demo/testTeeJay/plus/

# News Manager:
RewriteRule ^clanky/tag/([^/.]+)/?$ index.php?id=clanky&tag=$1 [L]
RewriteRule ^clanky/post/([^/.]+)/?$ index.php?id=clanky&post=$1 [L]
RewriteRule ^clanky/page/([^/.]+)/?$ index.php?id=clanky&page=$1 [L]
RewriteRule ^clanky/archive/([^/.]+)/?$ index.php?id=clanky&archive=$1 [L]
# end News Manager

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule /?([A-Za-z0-9_-]+)/?$ index.php?id=$1 [QSA,L]

When setting up the I18N custom permalink structure to have adresses like...
Code:
myaddress.com/en/news/
...I had to change the bottom part of the .htaccess, so now I have... (clanky = articles or news)
Code:
# News Manager nastaveni:
RewriteRule ^clanky/tag/([^/.]+)/?$ index.php?id=clanky&tag=$1 [L]
RewriteRule ^clanky/post/([^/.]+)/?$ index.php?id=clanky&post=$1 [L]
RewriteRule ^clanky/page/([^/.]+)/?$ index.php?id=clanky&page=$1 [L]
RewriteRule ^clanky/archive/([^/.]+)/?$ index.php?id=clanky&archive=$1 [L]
# end News Manager

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule /?([A-Za-z0-9_-]+)/?$ index.php?id=$1 [QSA,L]

RewriteRule ^/?$ cs/ [R,L]   # optional
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(cs|en)/(.*?/)?([A-Za-z0-9-]+)/?$ index.php?id=$3&lang=$1 [QSA,L]
RewriteRule ^(cs|en)/?$ index.php?lang=$1 [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule /?([A-Za-z0-9-]+)/?$ index.php?id=$1 [QSA,L]

However, the articles don't work. The can't show up, there is an error that the requested article couldn't be found. I think there is a language variable needed in front of "clanky/" in the News Manager text field. Interesting is that in the setup of the News Manager there is no more the option for Fancy URLs.

Thanks Smile
Tomáš Janeček - Multilingual personal website powered by GetSimple
» The little I did for GetSimple
Reply


Messages In This Thread
RE: I18N + News Manager = htaccess RewriteRules? - by TeeJay - 2013-04-05, 22:16:10



Users browsing this thread: 1 Guest(s)