#!/usr/bin/perl # by norikosama ( norikosama@gmail.com ) # 2010/04/23 # これを公開してから思ったのですが、Apacheレベルで解決できるじゃん、と・・・。 # URLが変わっても Apache を再起動しなくてすむ、ということで・・・。 use strict; use CGI; my $q = new CGI; my $type = $q->param('type'); my $url; if($type eq 't'){ $url = 'http://sns.gungho.jp/ro/?m=pc&a=page_c_topic_detail&target_c_commu_topic_id='; } elsif($type eq 'c'){ $url = 'http://sns.gungho.jp/ro/?m=pc&a=page_c_home&target_c_commu_id='; } elsif($type eq 'd'){ $url = 'http://sns.gungho.jp/ro/?m=pc&a=page_fh_diary&target_c_diary_id='; } elsif($type eq 'a'){ $url = 'http://sns.gungho.jp/ro/?m=pc&a=page_fh_album&target_c_album_id='; } else{ $url = 'http://sns.gungho.jp/ro/?m=pc&a=page_f_home&target_c_member_id='; } my $param = $q->param('id'); if($param =~/^[0-9]+$/){ $url = $url . $param; print $q->redirect($url); } else{ print $q->header; print "Error"; }