来自RewriteRule的htaccess异常。* index.php [QSA]

时间:2014-07-30 13:51:10

标签: .htaccess typo3

in typo3 htacces通过RewriteRule完成所有重定向。* index.php [QSA], 但我需要使用php aplication创建PromoCode foldier,并在adres www.domainname.com/PromoCode下创建自己的index.php。所以我需要在htacces中添加异常,但不确定如何......

RewriteRule ^rss\/([^\.]+).xml$ fileadmin/rss/$1.xml    [QSA,L]
#RewriteRule ^fileadmin\/(.*)$  fileadmin/$1    [QSA,L]

# SPECIAL
RewriteRule ^ua-ru/links807835.php fileadmin/links807835.php [QSA,L]


# PAGING
RewriteRule ^(.*)(?!order\/.*)\/order\/([^-]+)-([^\/]+)(.*)$    $1$4?pg_order=$2&pg_by=$3   [QSA,L]
RewriteRule ^(.*)(?!order\/.*)\/order\/([^\/]+)(.*)$    $1$3?pg_order=$2    [QSA,L]
RewriteRule ^(.*)(?!page\/.*)\/page\/([^\/]+)(.*)$  $1$3?pg_page=$2 [QSA,L]
RewriteRule ^(.*)(?!size\/.*)\/size\/([^\/]+)(.*)$  $1$3?pg_size=$2 [QSA,L]

# FAQ
RewriteRule ^(.*)(?!faq\/.*)\/faq\/([^\/]+)(.*)$    $1$3?faq=$2 [QSA,L]

# GALLERY
RewriteRule ^(.*)(?!gallery\/.*)\/gallery\/([^\/]+)(.*)$    $1$3?gallery=$2 [QSA,L]

# ARTICLE
RewriteRule ^(.*)(?!article\/.*)\/article\/([^\/]+)(.*)$    $1$3?article=$2 [QSA,L]

# PRODUCT
RewriteRule ^(.*)(?!product\/.*)\/product\/([^\/]+)(.*)$    $1$3?product=$2 [QSA,L]

# EVENT
RewriteRule ^(.*)(?!event\/.*)\/event\/([^\/]+)(.*)$    $1$3?event=$2   [QSA,L]

# MATERIAL
RewriteRule ^(.*)(?!material\/.*)\/material\/([^\/]+)(.*)$  $1$3?material=$2    [QSA,L]

# CATEGORY
RewriteRule ^(.*)(?!category\/.*)\/category([^\/]+)([^\/]+)(.*)$    $1$3?category=$2    [QSA,L]

# LANGUAGE
RewriteRule ^([^\/]*)\/$    $1?id=$1    [QSA]
RewriteRule ^([^\/]*)$ $1?id=$1 [QSA]
#RewriteRule ^([^\/]*)[\/]{0,1}(.*)$    $2?lang=$1  [QSA]
RewriteRule ^([^\/]*)[\/]{0,1}(.*)$  ?lang=$1 [QSA]

# PAGE
RewriteRule ^[\/]{0,1}([^\/]+)[\/]([^\/]+)[\/]([^\/]+)[\/]{0,1}(.*)$    ?id=$3&pid1=$2&pid2=$1  [QSA]
RewriteRule ^[\/]{0,1}([^\/]+)[\/]([^\/]+)[\/]{0,1}(.*)$    ?id=$2&pid1=$1  [QSA]
RewriteRule ^[\/]{0,1}([^\/]+)[\/]{0,1}(.*)$    ?id=$1  [QSA]

# FINISH
RewriteCond %{REQUEST_URI} !^/PromoCode/
RewriteRule .* index.php [QSA]

1 个答案:

答案 0 :(得分:0)

RewriteRule .* index.php行之前,添加以下条件:

RewriteCond %{REQUEST_URI} !^/promocode/

制作/promocode/文件夹,无论你想要为什么做个例子。