Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
.html in url
#1
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
Reply
#2
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]
Reply
#3
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.
Reply
#4
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¢
“Don’t forget the important ˚ (not °) on the a,” says the Unicode lover.
Help us test a key change for the core! ¶ Problems with GetSimple? Be sure to enable debug mode!
Reply




Users browsing this thread: 1 Guest(s)