Page 1 of 1

[SOLVED] Pretty URL's - Not working

Posted: Tue Oct 20, 2009 3:42 pm
by slicencode
Hi,

I've done all the changes (except for the metadata tag, the information shown in the metadata field is already in my templates so not sure if it'll be of much use), but I don't think my .htaccess is even functioning, see here:

http://www.colunas.ch/index.php?page=unsere-dienste

Try any of the links, it's not even doing any of the functions (I have the config set to mod rewrite and put the htaccess file as per the documentation in the root folder). I didn't have this issue with another site I run on a different box.

Code: Select all

  Options +FollowSymLinks
  RewriteEngine on
  RewriteBase /
 
  # 301 Redirect all requests that don't contain a dot or trailing slash to
  # include a trailing slash
  # except for form POSTS
  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]
Any ideas? (using 1.6.1 "Canala")

Many thanks in advance!

Re: Pretty URL's - Not working

Posted: Tue Oct 20, 2009 3:48 pm
by Jos
I don't read you have made changes to the config.php file?

And as far as I know the {metadata} tag has to be in...

Re: Pretty URL's - Not working

Posted: Tue Oct 20, 2009 4:00 pm
by slicencode
Jos wrote: I don't read you have made changes to the config.php file?

And as far as I know the {metadata} tag has to be in...
I've mentioned above that I have edited the config file, to my knowledge the metadata tag only screwed up images from time to time, as such it should still be rewriting the initial link.

Thanks for your reply :)

Edit: For the sake of this discussion, I've now added {metadata} to the template :)

Re: Pretty URL's - Not working

Posted: Tue Oct 20, 2009 4:12 pm
by Jos
Sorry, I overlooked it...
But my guess is still there must be something wrong in config.php, because thats where you can tell the system you want to have pretty urls.
The htaccess is only to interpret the url correctly (transform it internally to its original 'ugly' form.

Did you clear the cache?

Re: Pretty URL's - Not working

Posted: Tue Oct 20, 2009 4:19 pm
by slicencode
Thanks again for your reply Jos, well appreciated.

I had cleared cache, and just did it again, no go.

Here is my config:

Code: Select all

#------------
#URL Settings
#------------

#What type of URL rewriting should we be using for pretty URLs?  Valid options are:
#'none', 'internal', and 'mod_rewrite'.  'internal' will not work with IIS some CGI
#configurations. 'mod_rewrite' requires proper apache configuration, a valid
#.htaccess file and most likely {metadata} in your page templates.  For more
#information, see:
#http://wiki.cmsmadesimple.org/index.php/FAQ/Installation/Pretty_URLs#Pretty_URL.27s
$config['url_rewriting'] = 'mod_rewrite';

#Extension to use if you're using mod_rewrite for pretty URLs.
$config['page_extension'] = '/';

#If you're using the internal pretty url mechanism or mod_rewrite, would you like to
#show urls in their hierarchy?  (ex. http://www.mysite.com/parent/parent/childpage)
$config['use_hierarchy'] = true;

#If using none of the above options, what should we be using for the query string
#variable?  (ex. http://www.mysite.com/index.php?page=somecontent)
$config['query_var'] = 'page';
Funnily enough the links display correctly from the admin section when you hover over the magnifying glass.

In addition I used the "test" tool in CMSMS, output:

Code: Select all


Results

Owner: apache
Permissions:
  Owner: Read,Write
  Group: Read
  Other: Read

Re: Pretty URL's - Not working

Posted: Tue Oct 20, 2009 4:33 pm
by Jos
slicencode wrote: Funnily enough the links display correctly from the admin section when you hover over the magnifying glass.
Also points to the cache as the problem...
Did you go to Site Admin > Global Settings > tab Advanced setup?  or elsewhere

Re: Pretty URL's - Not working

Posted: Tue Oct 20, 2009 4:36 pm
by slicencode
Jos wrote:
slicencode wrote: Funnily enough the links display correctly from the admin section when you hover over the magnifying glass.
Also points to the cache as the problem...
Did you go to Site Admin > Global Settings > tab Advanced setup?  or elsewhere
Thanks Jos, that's exactly where I went (i.e. the "Clear Cache:" button)... could cache fail?

Edit: Went into the cache folder and all the files udpated to the current timestamp.

Re: Pretty URL's - Not working

Posted: Tue Oct 20, 2009 4:46 pm
by Jos
slicencode wrote:could cache fail?
Never heard of it to fail... and config.php is also oke... :-\

Is your menu generated by the {menu} tag? or are they hard-coded.

Re: Pretty URL's - Not working

Posted: Tue Oct 20, 2009 4:49 pm
by slicencode
Hard-coded, in flexible form. i.e. not" www.abc.com/index.php", but "index.php". Would this pose a difference?

Re: Pretty URL's - Not working

Posted: Tue Oct 20, 2009 4:51 pm
by Jos
Well, hardcoded links won't be transformed to pretty, if you want to code yourself, you also have to code the pretty part of it  ;)

Re: Pretty URL's - Not working

Posted: Tue Oct 20, 2009 5:28 pm
by slicencode
Did I totally forget that or what, lol :D

Thanks for your help :)

Re: Pretty URL's - Not working

Posted: Tue Oct 20, 2009 5:29 pm
by Dr.CSS
All this time and no one asked for a system info page paste?...

What does the system info say?...

Re: [SOLVED] Pretty URL's - Not working

Posted: Tue Oct 20, 2009 6:08 pm
by Jos
System info is nice, but not always relevant