Page 1 of 1

[SOLVED] Pretty url with multilingual site not working

Posted: Mon Jan 06, 2014 2:17 am
by uloloi
Hi all. I have problems to see pages, pretty_urls not working

building with CMS 1.11.6 this site: elfrijolito.com.mx
Trying this: http://docs.cmsmadesimple.org/configuration/pretty-url

And the pages are multilingual made with a tutorial by goran

home (redirects to language...)
-- en (english)
--- home
--- page 1
--- page 2, ...
-- es (spanish v.)
--- inicio
--- pagina 1
--- pag 2, ...

This site is located into a subfolder called /cms
I changed this into the .htacces file but nothing happens. I only get a 404 page, or it says that the page cannot be found

What could be the problem?

Re: Pretty urls with miltilingual site not working

Posted: Mon Jan 06, 2014 1:39 pm
by Jo Morg
uloloi wrote:This site is located into a subfolder called /cms
I changed this into the .htacces file but nothing happens. I only get a 404 page, or it says that the page cannot be found
And how exactly did you "changed this into the .htacces file"?

Re: Pretty urls with miltilingual site not working

Posted: Mon Jan 06, 2014 4:10 pm
by uloloi
Well, the .htaccess (from doc/htacces.txt, cmsms 1.11.6)
has this lines:

Code: Select all

<IfModule mod_rewrite.c>
RewriteEngine on
#
#Sub-dir e.g: /cmsms  IN MY CASE subfolder is /cms
RewriteBase /cms

# 301 Redirect all requests that don't contain a dot or trailing slash to
# include a trailing slash
# but ignore POST requests.
#RewriteCond %{REQUEST_URI} !/$
#RewriteCond %{REQUEST_URI} !\.
#RewriteCond %{REQUEST_METHOD} !POST$
#RewriteRule ^(.*) %{REQUEST_URI}/ [R=301,L]

# Rewrites urls in the form of /parent/child/
# but only rewrites if the requested URL is not a file or directory
#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?page=$1 [QSA]
</IfModule>

<IfModule mod_headers.c>
# Disable ETags
Header unset ETag
FileEtag None
# For Security
Header set X-Frame-Options "SAMEORIGIN"
</IfModule>
But RewriteBase /cms commented or not, pages not seen

Truely I don't know what to do to make it work, if the problem been here in the .htaccess or where is it, in other sites I haven't had this issue

I cleared cache, change confog, and so on, but still the problem

Re: Pretty urls with miltilingual site not working

Posted: Mon Jan 06, 2014 4:21 pm
by Rolf
{metadata} tag in the head of your template?

Re: Pretty urls with miltilingual site not working

Posted: Mon Jan 06, 2014 4:28 pm
by uloloi
Yes, I'm using bootstrap tpl

Code: Select all

  <head>
    <title>{if !empty($pagetitle)}...</title>
    {if isset($canonical)}<link rel="... />{/if} 
    {metadata} {* has: meta keywords, description and content-type *}
    <meta http-equiv="content-language" content="{$page_lang}" />
    <meta name='viewport' ... />
...
</head>

Re: Pretty urls with miltilingual site not working

Posted: Mon Jan 06, 2014 4:48 pm
by Rolf
Where did you put the .htaccess file? It should be *in* your /cms folder beside the cmsms index.php file

Try to add the root_url line into the config.php:

Code: Select all

$config['root_url'] = 'http://www.elfrijolito.com.mx/cms';

Re: Pretty urls with miltilingual site not working

Posted: Mon Jan 06, 2014 5:06 pm
by velden
At this moment your cmsms website is NOT in the /cms sub directory (at least not regarding the RewriteBase)
Working url: 'http://www.elfrijolito.com.mx/index.php?page=mainpage (and no '/cms' in it).

It is possible that your hosting provider does not allow or support .htaccess or mod_rewrite. In that case that would be the cause.

(error) log files of your web server would show you what's going on.

Re: Pretty urls with miltilingual site not working

Posted: Mon Jan 06, 2014 6:01 pm
by Jo Morg
HTTP Error 404 - File or directory not found.
Internet Information Services (IIS)
....
Technical Information (for support personnel)

Go to Microsoft Product Support Services and perform a title search for the words HTTP and 404.
Open IIS Help, which is accessible in IIS Manager (inetmgr), and search for topics titled Web Site Setup, Common Administrative Tasks, and About Custom Error Messages.
That means that you are in a MS server???... IIRC it doesn't recognize .htaccess directives.

Re: Pretty urls with miltilingual site not working

Posted: Mon Jan 06, 2014 9:03 pm
by uloloi
Yes, I think the problem must be there, looking into phpinfo():
Server API CGI/FastCGI
SERVER_SOFTWARE Microsoft-IIS/6.0
...and it appears that MS-ISS 6.0 does not have URL rewrite capabilities

Php not running on Apache Server

What to do? CGI Apps use .htaccess? some server administrator must configure something?

Re: Pretty urls with miltilingual site not working

Posted: Mon Jan 06, 2014 9:20 pm
by Rolf

Re: Pretty urls with miltilingual site not working

Posted: Mon Jan 06, 2014 9:52 pm
by uloloi
Working! :D Thanks

how I can remove 'index.php' from the string in the file. htaccess?
http://elfrijolito.com.mx/[b]index.php[/b]/es/inicio

Thanks for all!

Re: Pretty urls with miltilingual site not working

Posted: Mon Jan 06, 2014 9:58 pm
by Rolf
You can't... It is a Windoze thing...

Re: [SOLVED] Pretty url with multilingual site not working

Posted: Tue Jan 07, 2014 1:33 pm
by velden
Maybe your IIS server and/or hosting provider supports URL rewriting too. But I don't expect you'll find much support for it here.

But, if you find out how it works, you might want to share it here for other IIS users.