I see whats happening, i used a script that loads html.php. Its a script that as far as i can understand, makes from:
about1234.html link---> t1234 --> in case t -- use 1234 and make a new url
this-is-a-topic-t1234.html -- same as above
but now /forum/post692957.html goed into the script and thats not working
Or i need to put a htacces rule before it opens the html.php script that says when post is in the url do this and dont use the html.php script.
Or i need to add something in the html.php script.
This is inmy htaccess:
#RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^(data/|js/|styles/|install/|favicon\.ico|crossdomain\.xml|robots\.txt) - [NC,L]
RewriteRule ^(.*)\.html html.php [NC,L]
RewriteRule ^.*$ index.php [NC,L]
This is the script in html.php:
<code><?php
function phpbb_redirect($url)
{
//exit;
header('HTTP/1.1 301 Moved Permanently');
header('Location: ' . $url);
exit;
}
function redirect_html()
{
if (!isset($_SERVER['REQUEST_URI']))
{
return;
}
$url = explode('/', $_SERVER['REQUEST_URI']);
$url = explode('.', array_pop($url));
if (array_pop($url) != 'html')
{
return;
}
$url = explode('-', array_pop($url));
$url = explode('u', array_pop($url));
$url = array_pop($url);
$type = substr($url, 0, 1);
/* get the next to last string */
if (is_numeric($type) == true && $type) { // There is pagination like are-you-a-new-member-introduce-here-t1737-10.html
$url_page = explode('/', $_SERVER['REQUEST_URI']);
$url_page = explode('-', array_pop($url_page));
$typestring = array_slice($url_page, count($url_page)-2, 1);
$typestring_check = $typestring[0];
//echo $url ."<br>";
//echo $typestring_check . "<br>";
//echo substr($typestring_check, 0,1) . "<br>";
$type = substr($typestring_check, 0,1);
//echo $type . "<br>";
//echo $type;
// if last string is int, its paginated
$id = intval(substr($typestring_check, 1));
$page = $url/10; //Division durch 10
//echo $page;
switch ($type)
{
case 't':
if ($id == 1){
phpbb_redirect('index.php?threads/' . $id . '/'); //redirect to first page
}else{
phpbb_redirect('index.php?threads/' . $id . '/page-' . $page); //redirect to paginated page
}
case 'f':
phpbb_redirect('index.php?forums/' . $id . '/');
}
} else { // No pagination (Maybe first page of the thread) like like are-you-a-new-member-introduce-here-t1737.html
$type = substr($url, 0, 1);
$id = substr ($url, 1);
//echo $id . "<br>";
//echo $type;
switch ($type)
{
case 't':
phpbb_redirect('index.php?threads/' . $id . '/');
case 'f':
phpbb_redirect('index.php?forums/' . $id . '/');
}
}
}
redirect_html();
include('index.php');</code>