0

I Need Help With My .htaccess file .. Now i have link like that http://www.afrogfx.com/20121028050853/Test.html
problem located with Slash / !! if you click on my link you will found link without style if remove slash you will get 404 Not Found Like That http://www.afrogfx.com/20121028050853Test.html
Try it !!
Here Is my .htaccess

    RewriteEngine On

    RewriteRule ^([a-zA-Z0-9-/]+).html$ readmore.php?url=$1
    RewriteRule ^([a-zA-Z0-9-/]+).html/$ readmore.php?url=$1

readmore.php

    <?php
    include ('config/connect_to_mysql.php');
    $url=$_GET['url'];
    if($_GET['url'])
    {
    $url=mysql_real_escape_string($_GET['url']);
    $url=$url.'.html'; //Friendly URL 

    $sql=mysql_query("select * from posts where url='$url'");
    $count=mysql_num_rows($sql);
    $row=mysql_fetch_array($sql);
    $title=$row['title'];
    $text=$row['text'];
    }
    else
    {
    echo '404 Page.';
    }

    ?>

Problem Here

    <?php
    include('styles/header.php');
    include ('styles/leftblock.php');
    include ('styles/mrnuleft.php');
    ?>






    <?php
    if($count)
    {

    echo "<h1>$title</h1><div class='text'>$text</div>";
    }
    else
    {
    echo "<h1>404 Page.</h1>";
    }
    ?>
2
Contributors
1
Reply
3
Views
4 Years
Discussion Span
Last Post by Squidge
0

in your .htaccess you need to have
RewriteBase

In mine i have this set as

RewriteBase /

So you will then rewrte your includes to:

<?php
include('/styles/header.php');
include ('/styles/leftblock.php');
include ('/styles/mrnuleft.php');
?>

Try this:

http://www.generateit.net/mod-rewrite/

Edited by Squidge

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.