Add tests

parent 93ece2fd
reinstall:
pip uninstall nginx-redirector -y && python setup.py develop
pip uninstall nginx-redirector -y && python setup.py install
......@@ -76,6 +76,6 @@ def main(args=None):
reader.read_htaccess(args.htaccess_file[0], args.map_name[0])
if __name__ == "__main__":
main()
#if __name__ == "__main__":
# main()
......@@ -51,6 +51,6 @@ def main(args=None):
print("CRITICAL:\n" + str(e))
if __name__ == "__main__":
main()
#if __name__ == "__main__":
# main()
RewriteRule ^$ /cgi-bin/index.cgi [L]
RewriteRule ([0-9A-Za-z]{12})-del-([0-9A-Za-z]+)/.+$ /cgi-bin/index.cgi?del=$1-$2 [L]
RedirectMatch 301 ^/manual/(.*)$ http://www.php.net/manual/$1
RewriteRule ^([0-9A-Za-z]{12})(\.html?|$)$ /cgi-bin/index.cgi?op=download1&id=$1 [L]
RewriteRule ^([0-9A-Za-z]{12})(\/.+|\.html?|$) /cgi-bin/index.cgi?op=download1&id=$1&fname=$2 [L]
RedirectMatch 301 /java/jwarehouse/org.eclipse.(.*)/(.*) http://www.devdaily.com/java/jwarehouse/eclipse/org.eclipse.$1/$2
RewriteRule ^([0-9A-Za-z\-_]{4,64})/([0-9A-Za-z]{12})$ /cgi-bin/index.cgi?op=download1&usr_login=$1&id=$2 [L]
RewriteRule ^([0-9A-Za-z\-_]{4,64})/([0-9A-Za-z]{12})(\/.+|\.html?|$) /cgi-bin/index.cgi?op=download1&usr_login=$1&id=$2&fname=$3 [L]
RewriteRule ^checkfiles\.html$ /cgi-bin/index.cgi?op=checkfiles [L]
Redirect 301 /2007/webmaster/custom-phpini-with-fastcgi-on-dreamhost.html /dreamhost/custom-phpini-with-fastcgi-on-dreamhost.html
RewriteRule ^contact\.html$ /cgi-bin/index.cgi?op=contact [L]
RewriteRule ^premium\.html$ /cgi-bin/index.cgi?op=payments [L]
RedirectMatch 301 ^/(.*)/htaccesselite-ultimate-htaccess-article.html(.*) /htaccess/htaccess.html
RewriteRule ^login\.html$ /cgi-bin/index.cgi?op=login [L]
Redirect 301 /2007/phpbb/sending-post-form-data-with-php-curl.html /htaccess/sending-post-form-data-with-php-curl.html
RewriteRule ^catalogue(.*)\.html$ /cgi-bin/index.cgi?op=catalogue&date=$1 [L]
RewriteRule ^news([0-9]*)\.html$ /cgi-bin/index.cgi?op=news&page=$1 [L]
Redirect 301 /2007/webmaster/custom-phpini-with-fastcgi-on-dreamhost.html /dreamhost/custom-phpini-with-fastcgi-on-dreamhost.html
RewriteRule ^n([0-9]+)-.*\.html$ /cgi-bin/index.cgi?op=news_details&news_id=$1 [L]
RewriteRule ^free([0-9]+)\.html$ /cgi-bin/index.cgi?op=registration&aff_id=$1 [L]
RewriteRule ^users/([0-9A-Za-z\-_]{4,64})/?([0-9]+|$) /cgi-bin/index.cgi?op=user_public&usr_login=$1&fld_id=$2 [L]
RedirectMatch 301 ^/200([0-9])/([^01])(.*)$ /$2$3
RewriteRule ^embedmp3-([0-9A-Za-z]{12})\.html$ /cgi-bin/index.cgi?op=mp3_embed&file_code=$1 [L]
RewriteRule ^embedmp4-([0-9A-Za-z]{12})\.html$ /cgi-bin/index.cgi?op=mp32_embed&file_code=$1 [L]
RewriteRule ^box$ /cgi-bin/index_box.cgi [L]
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# RewriteRule ^$ /cgi-bin/index.cgi [L]
^$ /cgi-bin/index.cgi
# RewriteRule ([0-9A-Za-z]{12})-del-([0-9A-Za-z]+)/.+$ /cgi-bin/index.cgi?del=$1-$2 [L]
([0-9A-Za-z]{12})-del-([0-9A-Za-z]+)/.+$ /cgi-bin/index.cgi?del=$1-$2
# RedirectMatch 301 ^/manual/(.*)$ http://www.php.net/manual/$1
^/manual/(.*)$ http://www.php.net/manual/$1
# RewriteRule ^([0-9A-Za-z]{12})(\.html?|$)$ /cgi-bin/index.cgi?op=download1&id=$1 [L]
^([0-9A-Za-z]{12})(\.html?|$)$ /cgi-bin/index.cgi?op=download1&id=$1
# RewriteRule ^([0-9A-Za-z]{12})(\/.+|\.html?|$) /cgi-bin/index.cgi?op=download1&id=$1&fname=$2 [L]
^([0-9A-Za-z]{12})(\/.+|\.html?|$) /cgi-bin/index.cgi?op=download1&id=$1&fname=$2
# RedirectMatch 301 /java/jwarehouse/org.eclipse.(.*)/(.*) http://www.devdaily.com/java/jwarehouse/eclipse/org.eclipse.$1/$2
/java/jwarehouse/org.eclipse.(.*)/(.*) http://www.devdaily.com/java/jwarehouse/eclipse/org.eclipse.$1/$2
# RewriteRule ^([0-9A-Za-z\-_]{4,64})/([0-9A-Za-z]{12})$ /cgi-bin/index.cgi?op=download1&usr_login=$1&id=$2 [L]
^([0-9A-Za-z\-_]{4,64})/([0-9A-Za-z]{12})$ /cgi-bin/index.cgi?op=download1&usr_login=$1&id=$2
# RewriteRule ^([0-9A-Za-z\-_]{4,64})/([0-9A-Za-z]{12})(\/.+|\.html?|$) /cgi-bin/index.cgi?op=download1&usr_login=$1&id=$2&fname=$3 [L]
^([0-9A-Za-z\-_]{4,64})/([0-9A-Za-z]{12})(\/.+|\.html?|$) /cgi-bin/index.cgi?op=download1&usr_login=$1&id=$2&fname=$3
# RewriteRule ^checkfiles\.html$ /cgi-bin/index.cgi?op=checkfiles [L]
^checkfiles\.html$ /cgi-bin/index.cgi?op=checkfiles
# Redirect 301 /2007/webmaster/custom-phpini-with-fastcgi-on-dreamhost.html /dreamhost/custom-phpini-with-fastcgi-on-dreamhost.html
/2007/webmaster/custom-phpini-with-fastcgi-on-dreamhost.html /dreamhost/custom-phpini-with-fastcgi-on-dreamhost.html [status=301]
# RewriteRule ^contact\.html$ /cgi-bin/index.cgi?op=contact [L]
^contact\.html$ /cgi-bin/index.cgi?op=contact
# RewriteRule ^premium\.html$ /cgi-bin/index.cgi?op=payments [L]
^premium\.html$ /cgi-bin/index.cgi?op=payments
# RedirectMatch 301 ^/(.*)/htaccesselite-ultimate-htaccess-article.html(.*) /htaccess/htaccess.html
^/(.*)/htaccesselite-ultimate-htaccess-article.html(.*) /htaccess/htaccess.html
# RewriteRule ^login\.html$ /cgi-bin/index.cgi?op=login [L]
^login\.html$ /cgi-bin/index.cgi?op=login
# Redirect 301 /2007/phpbb/sending-post-form-data-with-php-curl.html /htaccess/sending-post-form-data-with-php-curl.html
/2007/phpbb/sending-post-form-data-with-php-curl.html /htaccess/sending-post-form-data-with-php-curl.html [status=301]
# RewriteRule ^catalogue(.*)\.html$ /cgi-bin/index.cgi?op=catalogue&date=$1 [L]
^catalogue(.*)\.html$ /cgi-bin/index.cgi?op=catalogue&date=$1
# RewriteRule ^news([0-9]*)\.html$ /cgi-bin/index.cgi?op=news&page=$1 [L]
^news([0-9]*)\.html$ /cgi-bin/index.cgi?op=news&page=$1
# Redirect 301 /2007/webmaster/custom-phpini-with-fastcgi-on-dreamhost.html /dreamhost/custom-phpini-with-fastcgi-on-dreamhost.html
/2007/webmaster/custom-phpini-with-fastcgi-on-dreamhost.html /dreamhost/custom-phpini-with-fastcgi-on-dreamhost.html [status=301]
# RewriteRule ^n([0-9]+)-.*\.html$ /cgi-bin/index.cgi?op=news_details&news_id=$1 [L]
^n([0-9]+)-.*\.html$ /cgi-bin/index.cgi?op=news_details&news_id=$1
# RewriteRule ^free([0-9]+)\.html$ /cgi-bin/index.cgi?op=registration&aff_id=$1 [L]
^free([0-9]+)\.html$ /cgi-bin/index.cgi?op=registration&aff_id=$1
# RewriteRule ^users/([0-9A-Za-z\-_]{4,64})/?([0-9]+|$) /cgi-bin/index.cgi?op=user_public&usr_login=$1&fld_id=$2 [L]
^users/([0-9A-Za-z\-_]{4,64})/?([0-9]+|$) /cgi-bin/index.cgi?op=user_public&usr_login=$1&fld_id=$2
# RedirectMatch 301 ^/200([0-9])/([^01])(.*)$ /$2$3
^/200([0-9])/([^01])(.*)$ /$2$3
# RewriteRule ^embedmp3-([0-9A-Za-z]{12})\.html$ /cgi-bin/index.cgi?op=mp3_embed&file_code=$1 [L]
^embedmp3-([0-9A-Za-z]{12})\.html$ /cgi-bin/index.cgi?op=mp3_embed&file_code=$1
# RewriteRule ^embedmp4-([0-9A-Za-z]{12})\.html$ /cgi-bin/index.cgi?op=mp32_embed&file_code=$1 [L]
^embedmp4-([0-9A-Za-z]{12})\.html$ /cgi-bin/index.cgi?op=mp32_embed&file_code=$1
# RewriteRule ^box$ /cgi-bin/index_box.cgi [L]
^box$ /cgi-bin/index_box.cgi
import unittest
from redirector.tests.utils import get_abs_path
from redirector.htaccess_parser import *
class EqualHtaccessReaderTest(unittest.TestCase):
def setUp(self):
self.reader = HtaccessReader()
def test_equal_map(self):
abs_test_path = get_abs_path('test.map')
test_file = open(abs_test_path, 'r')
test_lines_array = []
for line in test_file:
if len(line) > 2 or not line.startswith('#'):
test_lines_array.append(line)
test_file.close()
abs_htaccess_path = get_abs_path('.htaccess')
abs_convert_path = get_abs_path('convertation.map')
self.reader.read_htaccess(abs_htaccess_path, abs_convert_path)
convert_file = open(abs_convert_path, 'r')
convert_lines_array = []
for line in convert_file:
convert_lines_array.append(line)
convert_file.close()
self.assertEqual(test_lines_array, convert_lines_array)
import unittest
from redirector.tests.utils import get_abs_path
from redirector.redirector import *
class EqualRedirectorTest(unittest.TestCase):
def setUp(self):
self.redirector = Redirector()
def test_equal_map(self):
abs_yaml_path = get_abs_path('test.yaml')
abs_test_path = get_abs_path('test.map')
# RewriteRule ^$ /cgi-bin/index.cgi [L]
^$ /cgi-bin/index.cgi
# RewriteRule ([0-9A-Za-z]{12})-del-([0-9A-Za-z]+)/.+$ /cgi-bin/index.cgi?del=$1-$2 [L]
([0-9A-Za-z]{12})-del-([0-9A-Za-z]+)/.+$ /cgi-bin/index.cgi?del=$1-$2
# RedirectMatch 301 ^/manual/(.*)$ http://www.php.net/manual/$1
^/manual/(.*)$ http://www.php.net/manual/$1
# RewriteRule ^([0-9A-Za-z]{12})(\.html?|$)$ /cgi-bin/index.cgi?op=download1&id=$1 [L]
^([0-9A-Za-z]{12})(\.html?|$)$ /cgi-bin/index.cgi?op=download1&id=$1
# RewriteRule ^([0-9A-Za-z]{12})(\/.+|\.html?|$) /cgi-bin/index.cgi?op=download1&id=$1&fname=$2 [L]
^([0-9A-Za-z]{12})(\/.+|\.html?|$) /cgi-bin/index.cgi?op=download1&id=$1&fname=$2
# RedirectMatch 301 /java/jwarehouse/org.eclipse.(.*)/(.*) http://www.devdaily.com/java/jwarehouse/eclipse/org.eclipse.$1/$2
/java/jwarehouse/org.eclipse.(.*)/(.*) http://www.devdaily.com/java/jwarehouse/eclipse/org.eclipse.$1/$2
# RewriteRule ^([0-9A-Za-z\-_]{4,64})/([0-9A-Za-z]{12})$ /cgi-bin/index.cgi?op=download1&usr_login=$1&id=$2 [L]
^([0-9A-Za-z\-_]{4,64})/([0-9A-Za-z]{12})$ /cgi-bin/index.cgi?op=download1&usr_login=$1&id=$2
# RewriteRule ^([0-9A-Za-z\-_]{4,64})/([0-9A-Za-z]{12})(\/.+|\.html?|$) /cgi-bin/index.cgi?op=download1&usr_login=$1&id=$2&fname=$3 [L]
^([0-9A-Za-z\-_]{4,64})/([0-9A-Za-z]{12})(\/.+|\.html?|$) /cgi-bin/index.cgi?op=download1&usr_login=$1&id=$2&fname=$3
# RewriteRule ^checkfiles\.html$ /cgi-bin/index.cgi?op=checkfiles [L]
^checkfiles\.html$ /cgi-bin/index.cgi?op=checkfiles
# Redirect 301 /2007/webmaster/custom-phpini-with-fastcgi-on-dreamhost.html /dreamhost/custom-phpini-with-fastcgi-on-dreamhost.html
/2007/webmaster/custom-phpini-with-fastcgi-on-dreamhost.html /dreamhost/custom-phpini-with-fastcgi-on-dreamhost.html [status=301]
# RewriteRule ^contact\.html$ /cgi-bin/index.cgi?op=contact [L]
^contact\.html$ /cgi-bin/index.cgi?op=contact
# RewriteRule ^premium\.html$ /cgi-bin/index.cgi?op=payments [L]
^premium\.html$ /cgi-bin/index.cgi?op=payments
# RedirectMatch 301 ^/(.*)/htaccesselite-ultimate-htaccess-article.html(.*) /htaccess/htaccess.html
^/(.*)/htaccesselite-ultimate-htaccess-article.html(.*) /htaccess/htaccess.html
# RewriteRule ^login\.html$ /cgi-bin/index.cgi?op=login [L]
^login\.html$ /cgi-bin/index.cgi?op=login
# Redirect 301 /2007/phpbb/sending-post-form-data-with-php-curl.html /htaccess/sending-post-form-data-with-php-curl.html
/2007/phpbb/sending-post-form-data-with-php-curl.html /htaccess/sending-post-form-data-with-php-curl.html [status=301]
# RewriteRule ^catalogue(.*)\.html$ /cgi-bin/index.cgi?op=catalogue&date=$1 [L]
^catalogue(.*)\.html$ /cgi-bin/index.cgi?op=catalogue&date=$1
# RewriteRule ^news([0-9]*)\.html$ /cgi-bin/index.cgi?op=news&page=$1 [L]
^news([0-9]*)\.html$ /cgi-bin/index.cgi?op=news&page=$1
# Redirect 301 /2007/webmaster/custom-phpini-with-fastcgi-on-dreamhost.html /dreamhost/custom-phpini-with-fastcgi-on-dreamhost.html
/2007/webmaster/custom-phpini-with-fastcgi-on-dreamhost.html /dreamhost/custom-phpini-with-fastcgi-on-dreamhost.html [status=301]
# RewriteRule ^n([0-9]+)-.*\.html$ /cgi-bin/index.cgi?op=news_details&news_id=$1 [L]
^n([0-9]+)-.*\.html$ /cgi-bin/index.cgi?op=news_details&news_id=$1
# RewriteRule ^free([0-9]+)\.html$ /cgi-bin/index.cgi?op=registration&aff_id=$1 [L]
^free([0-9]+)\.html$ /cgi-bin/index.cgi?op=registration&aff_id=$1
# RewriteRule ^users/([0-9A-Za-z\-_]{4,64})/?([0-9]+|$) /cgi-bin/index.cgi?op=user_public&usr_login=$1&fld_id=$2 [L]
^users/([0-9A-Za-z\-_]{4,64})/?([0-9]+|$) /cgi-bin/index.cgi?op=user_public&usr_login=$1&fld_id=$2
# RedirectMatch 301 ^/200([0-9])/([^01])(.*)$ /$2$3
^/200([0-9])/([^01])(.*)$ /$2$3
# RewriteRule ^embedmp3-([0-9A-Za-z]{12})\.html$ /cgi-bin/index.cgi?op=mp3_embed&file_code=$1 [L]
^embedmp3-([0-9A-Za-z]{12})\.html$ /cgi-bin/index.cgi?op=mp3_embed&file_code=$1
# RewriteRule ^embedmp4-([0-9A-Za-z]{12})\.html$ /cgi-bin/index.cgi?op=mp32_embed&file_code=$1 [L]
^embedmp4-([0-9A-Za-z]{12})\.html$ /cgi-bin/index.cgi?op=mp32_embed&file_code=$1
# RewriteRule ^box$ /cgi-bin/index_box.cgi [L]
^box$ /cgi-bin/index_box.cgi
projects:
- map: ./test.map
prefix: /test
import os
def get_abs_path(fname):
curr_dir = os.path.dirname(os.path.realpath(__file__))
rel_path = os.path.relpath(fname, start=curr_dir)
abs_path = os.path.join(rel_path, curr_dir, os.path.basename(fname))
abs_path = os.path.normpath(abs_path)
return abs_path
......@@ -113,14 +113,14 @@ class ConfigReader:
res_prefix = None
# normalize path
yaml_dir = os.path.dirname(os.path.abspath(yaml_file))
map_file_name = os.path.split(map_file)[-1] # get tail of map path from arg
yaml_dir = os.path.dirname(os.path.abspath(yaml_file)) # get yaml file directory for restore rel path to map file
map_file_name = os.path.basename(map_file) # get filename from arg
try:
for map_path, prefix in self.parse_yaml(yaml_file):
rel_map_path = os.path.relpath(map_path, start=yaml_dir)
abs_map_path = os.path.join(rel_map_path, yaml_dir, os.path.basename(map_path))
abs_map_path = os.path.normpath(abs_map_path)
rel_map_path = os.path.relpath(map_path, start=yaml_dir) # restore rel path for map file
abs_map_path = os.path.join(rel_map_path, yaml_dir, os.path.basename(map_path)) # join rel path with yaml dir and map filename
abs_map_path = os.path.normpath(abs_map_path) # normalize path for removing "../", "./" and etc.
if map_file_name in abs_map_path:
res_prefix = prefix.split("/")[-1] # Last directory of map_path a project's name
......
......@@ -104,6 +104,6 @@ def watch(args=None):
redirector_watch.watch(args.filename[0])
if __name__ == "__main__":
watch()
#if __name__ == "__main__":
# watch()
......@@ -21,7 +21,7 @@ classifiers_list = [
setup(
name=const.NAME,
version="0.1.1",
packages=['redirector', 'redirector.utils'],
packages=['redirector', 'redirector.utils', 'redirector.tests'],
entry_points={
'console_scripts': [
'redirector = redirector.redirector:main',
......
# RewriteRule ^$ /cgi-bin/index.cgi [L]
^$ /cgi-bin/index.cgi
# RewriteRule ([0-9A-Za-z]{12})-del-([0-9A-Za-z]+)/.+$ /cgi-bin/index.cgi?del=$1-$2 [L]
([0-9A-Za-z]{12})-del-([0-9A-Za-z]+)/.+$ /cgi-bin/index.cgi?del=$1-$2
# RedirectMatch 301 ^/manual/(.*)$ http://www.php.net/manual/$1
^/manual/(.*)$ http://www.php.net/manual/$1
# RewriteRule ^([0-9A-Za-z]{12})(\.html?|$)$ /cgi-bin/index.cgi?op=download1&id=$1 [L]
^([0-9A-Za-z]{12})(\.html?|$)$ /cgi-bin/index.cgi?op=download1&id=$1
# RewriteRule ^([0-9A-Za-z]{12})(\/.+|\.html?|$) /cgi-bin/index.cgi?op=download1&id=$1&fname=$2 [L]
^([0-9A-Za-z]{12})(\/.+|\.html?|$) /cgi-bin/index.cgi?op=download1&id=$1&fname=$2
# RedirectMatch 301 /java/jwarehouse/org.eclipse.(.*)/(.*) http://www.devdaily.com/java/jwarehouse/eclipse/org.eclipse.$1/$2
/java/jwarehouse/org.eclipse.(.*)/(.*) http://www.devdaily.com/java/jwarehouse/eclipse/org.eclipse.$1/$2
# RewriteRule ^([0-9A-Za-z\-_]{4,64})/([0-9A-Za-z]{12})$ /cgi-bin/index.cgi?op=download1&usr_login=$1&id=$2 [L]
^([0-9A-Za-z\-_]{4,64})/([0-9A-Za-z]{12})$ /cgi-bin/index.cgi?op=download1&usr_login=$1&id=$2
# RewriteRule ^([0-9A-Za-z\-_]{4,64})/([0-9A-Za-z]{12})(\/.+|\.html?|$) /cgi-bin/index.cgi?op=download1&usr_login=$1&id=$2&fname=$3 [L]
^([0-9A-Za-z\-_]{4,64})/([0-9A-Za-z]{12})(\/.+|\.html?|$) /cgi-bin/index.cgi?op=download1&usr_login=$1&id=$2&fname=$3
# RewriteRule ^checkfiles\.html$ /cgi-bin/index.cgi?op=checkfiles [L]
^checkfiles\.html$ /cgi-bin/index.cgi?op=checkfiles
# Redirect 301 /2007/webmaster/custom-phpini-with-fastcgi-on-dreamhost.html /dreamhost/custom-phpini-with-fastcgi-on-dreamhost.html
/2007/webmaster/custom-phpini-with-fastcgi-on-dreamhost.html /dreamhost/custom-phpini-with-fastcgi-on-dreamhost.html [status=301]
# RewriteRule ^contact\.html$ /cgi-bin/index.cgi?op=contact [L]
^contact\.html$ /cgi-bin/index.cgi?op=contact
# RewriteRule ^premium\.html$ /cgi-bin/index.cgi?op=payments [L]
^premium\.html$ /cgi-bin/index.cgi?op=payments
# RedirectMatch 301 ^/(.*)/htaccesselite-ultimate-htaccess-article.html(.*) /htaccess/htaccess.html
^/(.*)/htaccesselite-ultimate-htaccess-article.html(.*) /htaccess/htaccess.html
# RewriteRule ^login\.html$ /cgi-bin/index.cgi?op=login [L]
^login\.html$ /cgi-bin/index.cgi?op=login
# Redirect 301 /2007/phpbb/sending-post-form-data-with-php-curl.html /htaccess/sending-post-form-data-with-php-curl.html
/2007/phpbb/sending-post-form-data-with-php-curl.html /htaccess/sending-post-form-data-with-php-curl.html [status=301]
# RewriteRule ^catalogue(.*)\.html$ /cgi-bin/index.cgi?op=catalogue&date=$1 [L]
^catalogue(.*)\.html$ /cgi-bin/index.cgi?op=catalogue&date=$1
# RewriteRule ^news([0-9]*)\.html$ /cgi-bin/index.cgi?op=news&page=$1 [L]
^news([0-9]*)\.html$ /cgi-bin/index.cgi?op=news&page=$1
# Redirect 301 /2007/webmaster/custom-phpini-with-fastcgi-on-dreamhost.html /dreamhost/custom-phpini-with-fastcgi-on-dreamhost.html
/2007/webmaster/custom-phpini-with-fastcgi-on-dreamhost.html /dreamhost/custom-phpini-with-fastcgi-on-dreamhost.html [status=301]
# RewriteRule ^n([0-9]+)-.*\.html$ /cgi-bin/index.cgi?op=news_details&news_id=$1 [L]
^n([0-9]+)-.*\.html$ /cgi-bin/index.cgi?op=news_details&news_id=$1
# RewriteRule ^free([0-9]+)\.html$ /cgi-bin/index.cgi?op=registration&aff_id=$1 [L]
^free([0-9]+)\.html$ /cgi-bin/index.cgi?op=registration&aff_id=$1
# RewriteRule ^users/([0-9A-Za-z\-_]{4,64})/?([0-9]+|$) /cgi-bin/index.cgi?op=user_public&usr_login=$1&fld_id=$2 [L]
^users/([0-9A-Za-z\-_]{4,64})/?([0-9]+|$) /cgi-bin/index.cgi?op=user_public&usr_login=$1&fld_id=$2
# RedirectMatch 301 ^/200([0-9])/([^01])(.*)$ /$2$3
^/200([0-9])/([^01])(.*)$ /$2$3
# RewriteRule ^embedmp3-([0-9A-Za-z]{12})\.html$ /cgi-bin/index.cgi?op=mp3_embed&file_code=$1 [L]
^embedmp3-([0-9A-Za-z]{12})\.html$ /cgi-bin/index.cgi?op=mp3_embed&file_code=$1
# RewriteRule ^embedmp4-([0-9A-Za-z]{12})\.html$ /cgi-bin/index.cgi?op=mp32_embed&file_code=$1 [L]
^embedmp4-([0-9A-Za-z]{12})\.html$ /cgi-bin/index.cgi?op=mp32_embed&file_code=$1
# RewriteRule ^box$ /cgi-bin/index_box.cgi [L]
^box$ /cgi-bin/index_box.cgi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment