Jump to content
  • 0

редирект на новый адрес


macbeth9
 Share

Question

Извиняюсь)) еще один вопрос..и так у меня выводятся статьи по ссылке http:/site.ru/goroda/c.php?id=3 , в htaccess я сделал чтобы адрес был http:/site.ru/goroda/c-3.html, тут все в порядке но! работает адрес http:/site.ru/goroda/c.php?id=3, и так как сделать чтобы адрес новый работал а старый нет (переадресация)?..делал в htaccess редирект RewriteRule ^goroda/c.php?id=$1 goroda/c-(.*).html [R=permanent] НЕ работает

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 0

не работает(( может дело в этом коде?

<? include ("../blocks/db.php");
if (isset($_GET['id'])) {$id = $_GET['id']; }
if (!isset($id)) {$id = 1;}
if (!preg_match("|^[\d]+$|", $id)) {
include('../404.php');
exit;
}
$result = mysql_query("SELECT * FROM goroda WHERE id='$id'",$db);
if (!$result)
{
include('../404.php');
exit(mysql_error());
}
if (mysql_num_rows($result) > 0)

{
$myrow = mysql_fetch_array($result);

}
else
{
include('../404.php');
exit();
}
?>

Link to comment
Share on other sites

  • 0

AddDefaultCharset windows-1251

php_value error_reporting 7

php_value max_execution_time 60

ErrorDocument 403 /403.php

ErrorDocument 404 /404.php

RewriteRule ^.htaccess$ - [F]

<Files ~ "\.(inc|conf|cfg)$">

deny from all

</Files>

RewriteEngine on

RewriteBase /

RewriteCond %{REQUEST_URI} ^(.*)/$

RewriteRule .* - [L]

RewriteCond %{ENV:REDIRECT_STATUS} 200

RewriteRule .* - [L]

RewriteCond %{REQUEST_METHOD} =GET

RewriteCond %{REQUEST_URI} ^(.*)/index.php$

RewriteRule ^(.*)$ %1/ [R=301,L]

RewriteRule ^dostoprim/(.*)-(.*).html$ dostoprim/view.php?id=$1-$2 [L]

RewriteRule ^shop/(.*)-(.*) shop/view.php?id=$1-$2 [L]

RewriteRule ^calendar/(.*)-(.*) calendar/view.php?id=$1-$2 [L]

RewriteRule ^goroda/c-(.*).html goroda/c.php?id=$1 [L]

RewriteRule ^pogoda/2.php$ pogoda/2 [R=permanent]

RewriteRule ^pogoda/2 pogoda/2.php [L]

RewriteRule ^carta/ carta/index.php [L]

RewriteRule ^(.*)\.htm$ $1.html [R=permanent]

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  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.

 Share

×
×
  • 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. See more about our Guidelines and Privacy Policy