Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How can I enable sef urls if nanoCMS shows mod_rewrite as disabled?
22-01-2010, 10:01 AM (This post was last modified: 04-03-2010 07:15 PM by Andrew.)
Post: #1
How can I enable sef urls if nanoCMS shows mod_rewrite as disabled?
Update 4th March '10: This document is for those using nanoCMS 0.4. People using nanoCMS Community builds 0.5 or later don't need to read it.

Q. How can I enable search engine friendly urls if nanoCMS shows mod_rewrite as disabled?

A. As part of the changes from 0.3 to 0.4 search engine friendly url's were handled differently. Some people who were previously using them with nanoCMS 0.31, couldn't enable them via the admin control panel of 0.4.

Note: The Community Build 0.5 (Winter build) resolves this problem.

A solution to try:

1) Open 'admin.settings.lib.php' from the 'data/libs' directory for editing.

2) Replace:

$is_modrewrite_available = false;
if( function_exists('apache_get_modules') ){
if(in_array('mod_rewrite',apache_get_modules()))
$is_modrewrite_available = true;
}

with just:

$is_modrewrite_available = true;

3) Upload the modified file.

4) Now place a .htaccess file in the root of your web hosting (same directory as index.php and style.css). Here is an example of an .htaccess file.

# NanoCMS v0.4 SEF url's mod_rewrite file
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?page=$1 [L]

5) Now go back into nanoCMS admin and try to enable sef's. If now enabled test browsing your site to see if sef's are working correctly.

Thank you to Alec Gorge for the .htaccess example.
www.andrewemmett.co.uk - lifestyle, tech and all sorts of geek
Find all posts by this user
21-07-2010, 09:52 AM
Post: #2
RE: How can I enable sef urls if nanoCMS shows mod_rewrite as disabled?
look like more useful
Find all posts by this user








Forum Jump:


User(s) browsing this thread: 1 Guest(s)