• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

mod_rewrite - problem

Status
Not open for further replies.

gameover99097

Banned User
Joined
Nov 19, 2010
Messages
270
Reaction score
4
Siemanko , próbuje sobie przekształcić linki do acc gesiora z tym modem i mam problemy , mogł by ktoś podrzucić przykład .htaccess jak zmienić z tego subtopic na zwykłe /nazwa.php ?


mój ht.. wygląda tak :

Code:
Options FollowSymLinks
RewriteEngine On
RewriteRule ^latestnews/([^/]+)/?$ subtopic=latestnews [L]
robie tą na xamppie na windowsie dla testu mam wączoną funkcje mod_rewirte.
i wyskakuje błąd 404 nie znleziono obketu przy wpisaniu 127.0.0.1/latestnews/
 
Last edited:
RewriteEngine On
Options +FollowSymlinks

RewriteBase /


RewriteRule ^news/$ ?subtopic=latestnews
ja mam tak i hula
 
PHP:
RewriteRule ^(.*)$ /$1/ [R]
RewriteRule ^/(.*)/$ /?subtopic=$1
chyba o to ci chodziło..., bedzie dzialac ze wszystkim /characters/, /latestnews/, /highscores/ itd.
 
RewriteEngine On
Options +FollowSymlinks

RewriteBase /


RewriteRule ^news/$ ?subtopic=latestnews
ja mam tak i hula

działa ,ale sam kod ,bez .css i grafk.

a co do twojego pomysłu Azi to , wyskakuje zbyt wiele przekierowań.
 
nie wiem czy dobrze skumałem ale ni chu.. dalej to samo .

Taki przykład
RewriteEngine On
Options +FollowSymlinks

RewriteBase /

RewriteRule ^latestnews/$ ?subtopic=latestnews
RewriteRule ^archive/$ ?subtopic=archive

RewriteRule ^adminpanel/$ ?subtopic=adminpanel
RewriteRule ^accountmanagement/$ ?subtopic=accountmanagement
RewriteRule ^accountmanagement_logout/$ ?subtopic=accountmanagement&action=logout
RewriteRule ^createaccount/$ ?subtopic=createaccount
RewriteRule ^lostaccount/$ ?subtopic=lostaccount
RewriteRule ^tibiarules/$ ?subtopic=tibiarules

RewriteRule ^characters/$ ?subtopic=characters
RewriteRule ^highscores/$ ?subtopic=highscores
RewriteRule ^killstatistics/$ ?subtopic=killstatistics
RewriteRule ^bans/$ ?subtopic=bans
RewriteRule ^houses/$ ?subtopic=houses
RewriteRule ^cleanhouses/$ ?subtopic=cleanhouses
RewriteRule ^guilds/$ ?subtopic=guilds
RewriteRule ^records/$ ?subtopic=records
RewriteRule ^team/$ ?subtopic=team

RewriteRule ^creatures/$ ?subtopic=creatures
RewriteRule ^spells/$ ?subtopic=spells
RewriteRule ^whoisonline/$ ?subtopic=whoisonline
RewriteRule ^serverinfo/$ ?subtopic=serverinfo
RewriteRule ^downloads/$ ?subtopic=downloads
RewriteRule ^gallery/$ ?subtopic=gallery

RewriteRule ^forum/$ ?subtopic=forum

RewriteRule ^topguilds/$ ?subtopic=topguilds
RewriteRule ^wars/$ ?subtopic=wars
RewriteRule ^topfrags/$ ?subtopic=topfrags

RewriteRule ^buypoints/$ ?subtopic=buypoints
RewriteRule ^shopsystem/$ ?subtopic=shopsystem
RewriteRule ^show_history/$ ?subtopic=shopsystem&action=show_history

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1250" />
<title><?PHP echo $title; ?></title>
<link rel="stylesheet" href="/<?PHP echo $layout_name; ?>/default.css" type="text/css" />
<link rel="stylesheet" href="/<?PHP echo $layout_name; ?>/basic.css" type="text/css" />
</head>
<body>
<div id="page">
<div id="top">
<div id="left">
<div id="left-top">
<div class="status">
<?PHP
if($config['status']['serverStatus_online'] == 1)
echo '
<span class="online"><center>Server Online</center></span><br/><br />
<b>Players Online:</b><br /> '.$config['status']['serverStatus_players'].' / '.$config['status']['serverStatus_playersMax'].'<br />
<b>Uptime:</b><br /> '.$config['status']['serverStatus_uptime'].'<br />
<b>Monsters:</b><br /> '.$config['status']['serverStatus_monsters'].'
';
else
echo '<span class="offline">Server Offline</span>';
?>
</div>
</div>
</div>
<div id="right">
<div id="logo">

</div>
</div>
</div>
<div id="cnt-container">
<div id="left">
<div id="menu">
<ul>
<center><b><font size="4" color="white">Menu</font><br></b></center>
<li><font color="yellow">News</font></li>
<ul id="sub">
<li><a href="/latestnews/"><font color="white">Latest News</font></a></li>
<li><a href="/archive/"><font color="white">News Archive</font></a></li>
</ul>
<li><font color="yellow">Account</font></li>
<ul id="sub">
<?PHP
if($group_id_of_acc_logged >= $config['site']['access_admin_panel'])
echo '<li><a href="/adminpanel/"><font color="white">Admin Panel</font></a></li>';
if($logged)
{
echo '<li><a href="/accountmanagement/"><font color="red">My Account</font></a></li>
<li><a href="/accountmanagement_logout/"><font color="red">Logout</font></a></li>';
}
else
{
echo '<li><a href="/accountmanagement/"><font color="red">Login</font></a></li>';
}
?>
<li><a href="/createaccount/"><font color="red">Create Account</font></b></a></li>
<li><a href="/lostaccount/"><font color="white">Lost Account</font></a></li>
<li><a href="/tibiarules/"><font color="white">Server Rules</font></a></li>
</ul>
<li><font color="yellow">Community</font></li>
<ul id="sub">
<li><a href="/characters/"><font color="white">Search Player</font></a></li>
<li><a href="/highscores/"><font color="red">Highscores</font></a></li>
<li><a href="/killstatistics/"><font color="white">Last Deaths</font></a></li>
<li><a href="/bans/"><font color="white">Banishments</font></a></li>
<li><a href="/houses/"><font color="white">Houses</font></a></li>
<li><a href="/cleanhouses/"><font color="white">Clean Houses</font></a></li>
<li><a href="/guilds/"><font color="red">Guilds</font></a></li>
<li><a href="/records/"><font color="white">Player Records</font></a></li>
<li><a href="/team/"><font color="white">Game Masters</font></a></li>
</ul>
<li><font color="yellow">Library</font></li>
<ul id="sub">
<li><a href="/creatures/"><font color="white">Monsters</font></a></li>
<li><a href="/spells/"><font color="white">Spells</font></a></li>
<li><a href="/whoisonline/"><font color="white">Who is online?</font></a></li>
<?PHP if($config['site']['serverinfo_page'] == 1) echo '<li><a href="/serverinfo/"><font color="white">Server Info</font></a></li>'; ?>
<?PHP if($config['site']['download_page'] == 1) echo '<li><a href="/downloads/"><font color="white">Downloads</font></a></li>'; ?>
<?PHP if($config['site']['gallery_page'] == 1) echo '<li><a href="/gallery/"><font color="white">Gallery</font></a></li>'; ?>
</ul>
<li><font color="yellow">Rivenia Forum</font></li>
<ul id="sub">
<li><a href="/forum/"><font color="white">Forum</font></a></li>
</ul>
<li><font color="yellow">Statistics PVP</font></li>
<ul id="sub">
<li><a href="/topguilds/"><font color="white">Top Guilds</font></a></li>
<li><a href="/wars/"><font color="red">Wars Statistic</font></a></li>
<li><a href="/topfrags/"><font color="white">Top Frager</font></a></li>
</ul>
<?PHP
if($config['site']['shop_system'] == 1)
{
echo '<li><font color="yellow">Shop</font></li>
<ul>
<li><a href="/buypoints/"><b><font size="1" color="red">Buy Premium Points</font></b></a></li>
<li><a href="/shopsystem/"><font color="green">Shop Offer</font></a></li>';
if($logged)
echo '<li><a href="/show_history/"><font color="white">Shop History</font></a></li>';
echo '</ul>';
}
?>
</ul>
</div>
</div>
<div id="right">
<div id="content">
<div id="content-box-top"></div>
<div id="content-cnt-top">
<? echo $main_content; ?>
</div>
</div>
</div>
</div>
<div id="footer">
<p><center>Copyrignts &copy; 2011 by Rivenia 8.6. All rights Reserved.</center></p>
</div>
</div>
</body>
</html>

PHP:
RewriteRule ^(.*)$ /$1/ [R]
RewriteRule ^/(.*)/$ /?subtopic=$1
chyba o to ci chodziło..., bedzie dzialac ze wszystkim /characters/, /latestnews/, /highscores/ itd.

Coś mi to nie działa
 
a tak na marginesie jak rozwiązać np. takie coś:
?subtopic=accountmanagement&action=newreckey
?
RewriteRule ^management/$ acc/index.php?subtopic=accountmanagement
?
 
U mnie występują błędy jak wchodzę w poszczególną stronę np ip/latestnews/

Code:
Fatal error: Call to a member function query() on a non-object in /var/www2/latestnews.php on line 20

gdzie htacces

Code:
RewriteEngine On
Options +FollowSymlinks

RewriteBase /

RewriteRule ^latestnews/$ ?subtopic=latestnews

a lay
Code:
<center><li><a href="/latestnews/"><font color="gray"><b>Latest News</b></font></a></li>

W czym problem tkwi ? ;/
 
Wie ktoś jak zrobić tego typu zmienną
?subtopic=forum&action=show_thread&id='.$row['id'].'

RewriteRule ^subtopic/latestnews/$ ?subtopic=latestnews

ja tego nie czaje, nie na moją głowe :D

edit: dobra już wiem
RewriteRule ^subtopic/characters/name/'.urlencode($row['name']).'">'.$row['name'].'/$ ?subtopic=characters&name='.urlencode($row['name']).'">'.$row['name'].'
Przykład na posted by może sie komuś przyda
 
Last edited:
U mnie występują błędy jak wchodzę w poszczególną stronę np ip/latestnews/

Code:
Fatal error: Call to a member function query() on a non-object in /var/www2/latestnews.php on line 20

W czym problem tkwi ? ;/
w include, require_once, podaj pełną ścieżkę do plików z pot, bo ci szuka w folderach np. /latestnews/pot/...
 
Status
Not open for further replies.
Back
Top