开发者

Redirect 301 cgi-bin/ to new URL

开发者 https://www.devze.com 2023-03-26 07:49 出处:网络
it\'s my first question here :) I got a problem for redirecting URL: I have old URL like www.domain.com/cgi-bin/category.cgi?type=...

it's my first question here :)

I got a problem for redirecting URL:

I have old URL like www.domain.com/cgi-bin/category.cgi?type=... And try to redirect them to www.domain.com on the htaccess

but I still have 404 error...

This is my 开发者_Python百科rule :

RewriteRule ^cgi-bin/(.*)$ http://www.domain.com [R=301,L]

I verified if there are something in the conf about cgi-bin but nothing.

I did a test with "cgi-bin2" and it works...

So what can i do ?


I don't know where you problem come from but why don't you try to write a perl script which will redirect to your base domain url ?

(it can work if you have, for example, just few cgi files previously used).

In your example it seems you want to redirect "category.cgi".

so, in our case, write a "category.cgi" file in your "cgi-bin" folder and write this code inside it :

#!/usr/bin/perl
#
# fixedredir.cgi

use strict;
use warnings;


my $URL = "http://www.yourdomain.com/";

print "Status: 301 Moved\nLocation: $URL\n\n"

Hope it help !

0

精彩评论

暂无评论...
验证码 换一张
取 消