Posts: 56
Threads: 19
Joined: Aug 2009
2010-02-26, 18:58:53
(This post was last modified: 2010-02-26, 18:59:18 by lantonioli.)
anyone know how to add for all urls in gest simple .html at end of url
ex.
www.getsimple/page1.html
www.getsimple/page2.html
kotos.net - webdesign / dtp / graphics / photography
Posts: 17
Threads: 9
Joined: Feb 2010
2010-02-27, 00:54:18
(This post was last modified: 2010-02-27, 09:15:38 by Stobbsy.)
My solution only works if you are using single-level navigation, I have tested it in GetSimple v2.0
For first you must enable pretty urls in admin -> settings,
then edit admin/inc/theme_functions.php, lines 359-360, replace with it:
Code:
if ($url_nav == 'index' ) $url_nav = ''; else $url_nav .= '.html';
$menu .= "<li class=\"$classes\"><a href=\"{$SITEURL}{$url_nav}\" title=\"$page[title]\">$page[menu]</a></li>\n";
Then edit .htaccess file in the root of your site:
Code:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/?([A-Za-z0-9-]+)\.html/?$ index.php?id=$1 [L]
Posts: 17
Threads: 9
Joined: Feb 2010
I recommend remove link to main page from menu when current page is main.
(/admin/inc/theme_functions.php, lines 365-371)
Code:
if ($url_nav == 'index' and $currentpage == 'index')
$full_nav = "<li class=\"index current\">$page[menu]</li>";
else {
if ($url_nav == 'index') $url_nav = '';
$full_nav = "<li class=\"$classes\"><a href=\"{$SITEURL}{$url_nav}\" title=\"$page[title]\">$page[menu]</a></li>";
}
$menu .= $full_nav;
After it need to change theme css to restore old view.
Posts: 972
Threads: 27
Joined: Aug 2009
kirillaristov Wrote:Then edit .htaccess file in the root of your site:
Code:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/?([A-Za-z0-9-]+).html/?$ index.php?id=$1 [L]
I did not care to test it, but it doesn’t sound like it will work. The regular expression seems not to match child pages at all. Besides that I would recommend you remove the final /? before the $. If you want it to “fake†a normal HTML page it should never be followed by a slash.
kirillaristov Wrote:I recommend remove link to main page from menu when current page is main.
The only reason you would do this is if you do not want to have any self-links. In which case it goes for all pages, not just the main page. So I wouldn’t put much thought in it or make an if-clause that tests for all.
My 2¢