Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8969175
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T17:33:21+00:00 2026-06-15T17:33:21+00:00

I have an index.php and news.php and .htaccess files in my localhost/DIRECTORY/AID/ folder, and

  • 0

I have an index.php and news.php and .htaccess files in my localhost/DIRECTORY/AID/
folder, and I am basically trying send/receive data from index.php to news.php

This is a function inside the index.php, which creates a link from database query, and echos out a title of an article.

function news_preview() {
    $query = "SELECT * FROM updates ORDER BY update_id DESC LIMIT 5  ";
    $result = mysql_query($query) or die(mysql_error());
    while ($row = mysql_fetch_array($result)) {
        $url = "/news/$row[update_id]/" . preg_replace('/[^a-zA-Z0-9-_]/', '_',
            $row['update_title']);
        echo "<a href=\"$url\">  " . substr($row['update_title'], 0, 26) . "...</a><br/>";
    }
}

echo news_preview();

Now, here is what the .htaccess looks like

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^news/([0-9]+)/([A-Za-z0-9_-]+)$ DIRECTORY/AID/news.php?id=$1 [QSA,L]

Now, to the problem. Basically, when I clicked on the link (generated by news_preview() )
shown in the index.php, All I get in the news.php page is nothing. But, probably because I am trying to use the $_GET['title'] Although, I am not certain if that is how we retrieve data. But, the links take me to http://localhost/news/46/This_is_news_title
which is perfect, but I am getting the Object Not Found error

Below, is the image of the error I am getting.

enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T17:33:22+00:00Added an answer on June 15, 2026 at 5:33 pm

    Put this code in the htdocs/.htaccess:

    Options +FollowSymLinks -MultiViews
    # Turn mod_rewrite on
    RewriteEngine On
    
    RewriteBase /
    
    RewriteRule ^news/([0-9]+)/.*$ /DIRECTORY/AID/news.php?id=$1 [QSA,L,NC]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a couple of files named like index.php?page=1, news?id=1. How can I set
I have the file structure index.php .htaccess news/index.php news/.htaccess First .htaccess: RewriteEngine On RewriteBase
I have a index.php file which loads (require) 2 different files based on a
I have an index.php file which has 2 included files require(stats.php); require(stats_encry.php); stats.php which
I have a index.php file that will include several external files: content/templates/id1/template.php content/templates/id2/template.php content/templates/id3/template.php
I'm using Iirf v2.0 . I have the following directory structure: / /library /library/index.php
I have the folowing htaccess file: RewriteEngine on RewriteRule ^(.*)-(.*)-(.*)$ index.php?page=$1&id=$2&im=$3 And inside the
I have the following page: mysite.com/news/index.php?tag=tag&name=name&id=id I want to rewrite this so that it
I have Javascript updating my URI as below: /index.php?page=list#page=news But I would like to
I have the urls like http://localhost/mis http://localhost/mis/newsletter.php http://localhost/mis/cms.php?mainid=65 http://localhost/mis/news.php?mainid=93 Well I am using these

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.