Jump to content

Recommended Posts

Hi,

 

I am trying to do url rewriting on linux server through .htaccess file in my root directory.

 

the content of my .htaccess are

 

RewriteEngine on

RewriteRule ^test.cleanurl(\/.*)*$ /test.cleanurl.php

RewriteRule ^news(\/.*)*$ /news.php

 

 

 

 

this is the news.php file

 

 

<?php

require("class.cleanurl.php");

 

$clean = new CleanURL;

$clean->parseURL();

$clean->setRelative('relativeslash'); //relativeslash is variable name

$clean->setParts('id','page');

echo 'result query string:<br>';

echo 'id = '.$id . '<br>';

echo 'page = ' . $page . '<br>';

 

?>

<br>

Example Clean URL usage:  <br>

<a href="<?=$relativeslash?><?echo $link=CleanURL::makeClean('news.php?id=120&page=2');?>"><?=$link?></a>

 

 

 

final url is  news/120/2

 

but when i click on the URL I am getting this message.

 

 

Not Found

The requested URL /url/news/120/2 was not found on this server.

 

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

 

 

--------------------------------------------------------------------------------

 

Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.8e-fips-rhel5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 Server at www.goaseahomes.com Port 80

 

 

please help me what is the problem.

 

Thanks

 

 

Link to comment
https://forums.phpfreaks.com/topic/166047-htaccess-url-rewriting/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.