JOHNCMS mod_rewrite

Started on the old forum in October 2011 · view the original in the archive · old links redirect here

11 replies · 2,063 views · started 15 years ago · 1 min read

6 participants
sladex Developer · 232 posts #1

Hi, Can anyone help me and give me any WORKING mod_rewrite .htaccess file to change url for original johncms 4.4.0

Would be great. I tried my self.(first time) But it's nothing working. hostgator.com support couldn't run it. crap.

ozziemale31 Lead · 861 posts #3

re

sladex wrote: Hi, Can anyone help me and give me any WORKING mod_rewrite .htaccess file to change url for original johncms 4.4.0

Would be great. I tried my self.(first time) But it's nothing working. hostgator.com support couldn't run it. crap.

hostgator are crap for a start and most hosts if u have globals function on in htaccess and also php.ini it will throw errors like 500

edit htaccess

Options -Indexes ErrorDocument 402 JohnCMS / Build 929 ErrorDocument 403 JohnCMS / Build 929 ErrorDocument 404 JohnCMS / Build 929 ErrorDocument 500 JohnCMS / Build 929 DirectoryIndex index.php

RemoveHandler .phtml .php3 .php4 .php5 .php6 .phps .cgi .pl .asp .aspx .shtml .shtm .fcgi .fpl .jsp .py AddType application/x-httpd-php-source .phtml .php3 .php4 .php5 .php6 .phps .cgi .pl .asp .aspx .shtml .shtm .fcgi .fpl .jsp .py

php_flag display_errors 0 php_value error_reporting 7 php_value register_globals 0 php_flag session.use_trans_sid off php_value magic_quotes_gpc 0 php_value magic_quotes_runtime 0 php_value magic_quotes_sybase 0 php_value allow_url_fopen 0 php_value arg_separator.output "&" AddDefaultCharset UTF-8

<IfModule mod_expires.c> ExpiresActive On ExpiresDefault A1209600 <FilesMatch \.php$> ExpiresActive Off </FilesMatch> </IfModule>

RewriteEngine On RewriteCond %{REQUEST_METHOD} ^TRACE RewriteCond %{HTTP:range} !(^bytes=[^,]+(,[^,]+){0,4}$|^$) RewriteRule .* - [F]

External image (may be gone) External image (may be gone)

External image (may be gone)

*****

**Dont Ask Me Dumb Questions.Or you'l get a Dumb Answer.. Want A Profesional Logo or Theme For Your wap site Pm Me.If I Have The Time Ill Make It For Free ***

BDplanet Junior · 37 posts #4

try it working fine for me

Options -Indexes
ErrorDocument 402 http://rexbd.in
ErrorDocument 403 http://rexbd.in
ErrorDocument 404 http://rexbd.in
ErrorDocument 500 http://rexbd.in

RemoveHandler .phtml .php3 .php4 .php5 .php6 .phps .cgi .pl .asp .aspx .shtml .shtm .fcgi .fpl .jsp .py
AddType application/x-httpd-php-source .phtml .php3 .php4 .php5 .php6 .phps .cgi .pl .asp .aspx .shtml .shtm .fcgi .fpl .jsp .py

RewriteEngine On

RewriteRule ^forum/(.*)_([0-9]+).html$ forum/index.php?id=$2 [L]
RewriteRule ^forum/(.*)_([0-9]+)_p([0-9]+).html$ forum/index.php?id=$2&page=$3 [L]
RewriteRule ^forum/(.*)_p([0-9]+).html$ forum/index.php?act=post&id=$2 [L]
RewriteRule ^forum/(.*)_([0-9]+)_s([0-9]+).html$ forum/index.php?id=$2&start=$3 [L]
RewriteRule ^forum/(.*)_([0-9]+)_clip_p([0-9]+).html$ forum/index.php?id=$2&clip&page=$3 [L]

if any problem reply

bestman Junior · 32 posts #5

i am confused. It did not work for me and my forum is not in public_html, its in a folder named 'forum' so where and how do it put the htaccess file

bestman Junior · 32 posts #7

thanks Very Much. Its works Now, but another little problem is that, the Mod rewrite, did not work on 'latest Post'

what do i do now

BDplanet Junior · 37 posts #8

bestman wrote: thanks Very Much. Its works Now, but another little problem is that, the Mod rewrite, did not work on 'latest Post'

what do i do now

/*
-----------------------------------------------------------------
//last post by BDplanet
-----------------------------------------------------------------
*/
$set_forum = $datauser['set_forum'] ? unserialize($datauser['set_forum']) : array();
$settings = $set['lastThemes'] ? unserialize($set['lastThemes']) : array('totalThemes' => 8, 'timeCache' => 30);
if($settings['totalThemes'] > 0 && !$set_forum['viewThemes']) {
$themesOut = '';
$file_cache = 'files/cache/lastThemes.dat';
echo '<div class="mainblok"><div class="phdr"> <b>Last forum post</b>';
$req = mysql_query("SELECT * FROM `forum` WHERE `type`='t'" . ($rights >= 7 ? '' : " AND `close`!='1'") . " ORDER BY `time` DESC LIMIT " . $settings['totalThemes']);
while (($res = mysql_fetch_assoc($req)) !== false) {
if ($res['close']) $themesOut .= '<div class="rmenu">';
else $themesOut .=  $i % 2 ? '<div class="menu">' : '<div class="menu">';
$nickUser = mysql_fetch_assoc(mysql_query("SELECT `from` FROM `forum` WHERE `type` = 'm' AND `close` != '1' AND `refid` = '" . $res['id'] . "' ORDER BY `time` DESC LIMIT 1"));
$totalPosts = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum` WHERE `type`='m' AND `refid`='" . $res['id'] . "'" . ($rights >= 7 ? '' : " AND `close` != '1'")), 0);
$endPage = ceil($totalPosts/$kmess);
$icons = array(
(!$res['vip'] ? '<img src="../theme/' . $set_user['skin'] . '/images/op.gif" alt=""/>' : ''),
($res['vip'] ? '<img src="../theme/' . $set_user['skin'] . '/images/pt.gif" alt=""/>' : ''),
($res['realid'] ? '<img src="../theme/' . $set_user['skin'] . '/images/rate.gif" alt=""/>' : ''),
($res['edit'] ? '<img src="../theme/' . $set_user['skin'] . '/images/tz.gif" alt=""/>' : '')
);
$themesOut .= functions::display_menu($icons, ' ', ' ') .
'<a href="' . ___($res['text']) . '_' . $res['id'] . '.html">' . $res['text'] . '</a> [' . $totalPosts . ']';
$themesOut .= '<div class="sub">By: ' . $res['from'];
if (!empty($nickUser['from'])) $themesOut .= ' » ' . $nickUser['from'];
$themesOut .= ' </div></div>';
++$i;
}
echo '</div>';
if ($settings['timeCache'] > 0 && time() < (filemtime($file_cache) + $settings['timeCache'])) {
echo file_get_contents($file_cache);
} else {
echo $themesOut;
if($settings['timeCache'] > 0)
file_put_contents($file_cache, $themesOut);
}
}

echo '<div align="right"><a href="/forum/index.php"><b>More.. </b></a></div>';

echo '</div>';

try it if not work give me ur last post code here

laro696 Developer · 205 posts #11

What error do you get?

bestman Junior · 32 posts #12

there was no error with my own. Its just that the Mod rewrite did not work on my latest topic. So i gave him to help me Edit it. Can u help

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close