www.example.comとhtmlファイルのセットは、www.example.com/abcd/(ベータ版)にあります。これらのmod_rewriteルールが必要です).htaccessのmod_rewriteルールをhttpd.confに変換する
mod_rewriteルールは.htaccess内のディレクトリで正常に動作します。
ルールが.htaccessファイルに次のようになります。:私は、httpd.confでそれらを配置する必要があり
RewriteEngine On
RewriteBase /abcd/
RewriteRule ^.*/codelibrary/(.*)$ codelibrary/$1 [L]
RewriteRule ^.*/in_upload/images/(.*)$ in_upload/images/$1 [L]
...
コピー以下のhttpd.confファイルのdidntの仕事へ:
<VirtualHost *:80>
ServerAlias www.example.com
ServerAdmin [email protected]
DocumentRoot /var/www/html
ServerSignature On
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /abcd/
...
それエラーが発生しました:
RewriteBase: only valid in per-directory config files
このようなルールはすべて変更する必要がありますか?
RewriteRule ^.*/abcd/codelibrary/(.*)$ abcd/codelibrary/$1 [L]
RewriteRule ^.*/abcd/in_upload/images/(.*)$ abcd/in_upload/images/$1 [L]
EDIT1
私から次の行を変換しようとした:へ
...
RewriteRule (.*)ins.html$ browse.php?type=ins [L]
...
RewriteRule ^([a-zA-Z\-]*)/([a-zA-Z0-9\s]*)/([0-9]*)\.html$ browse.php?type=$1&catId=$3 [L]
RewriteRule ^([a-zA-Z\-]*)/([a-zA-Z0-9\s]*)/([a-zA-Z0-9\s]*)/([0-9]*)/([0-9]*)\.html$ browse.php?type=$1&catId=$4&subCatId=$5 [L]
...
:
...
RewriteRule ^/abcd/ins.html$ abcd/browse.php?type=ins [L]
...
RewriteRule ^/abcd/([a-zA-Z\-]*)/([a-zA-Z0-9\-\s]*)/([0-9]*)\.html$ abcd/browse.php?type=$1&catId=$3 [L]
RewriteRule ^/abcd/([a-zA-Z\-]*)/([a-zA-Z0-9\-\s]*)/([a-zA-Z0-9\-\s]*)/([0-9]*)/([0-9]*)\.html$ abcd/browse.php?type=$1&catId=$4&subCatId=$5 [L]
...
が、以下のように、私はエラーを得ました。
私はhttp://www.example.com/abcd/ins/Sustainability/282.htmlにアクセスしてみてください、私はログに次のエラーが表示されます。
IPADDRESS - - [DATETIME] [www.example.com/sid#2b3cde3c1be0][rid#2b3cec076e70/initial] (2) init rewrite engine with requested uri /abcd/ins/Sustainability/282.html
IPADDRESS - - [DATETIME] [www.example.com/sid#2b3cde3c1be0][rid#2b3cec076e70/initial] (2) rewrite '/abcd/ins/Sustainability/282.html' -> 'abcd/browse.php?type=ins&catId=282'
IPADDRESS - - [DATETIME] [www.example.com/sid#2b3cde3c1be0][rid#2b3cec076e70/initial] (2) local path result: abcd/browse.php
私はhttp://www.example.com/abcd/ins.htmlにアクセスしてみてください、私はログに次のエラーを取得:私は
IPADDRESS - - [DATETIME] [www.example.com/sid#2b3cde3c1be0][rid#2b3cec076e70/initial] (2) init rewrite engine with requested uri /abcd/ins.html
IPADDRESS - - [DATETIME] [www.example.com/sid#2b3cde3c1be0][rid#2b3cec076e70/initial] (2) rewrite '/abcd/ins.html' -> 'abcd/browse.php?type=ins'
IPADDRESS - - [DATETIME] [www.example.com/sid#2b3cde3c1be0][rid#2b3cec076e70/initial] (2) local path result: abcd/browse.php
を」 RewriteLogLevelを2に設定する
mod_rewriteルールの未修正バージョンは、https://webmasters.stackexchange.com/questions/4237/url-rewritten-pages-take-much-longer-to-load
こんにちは@Ben - 私は変更はエラーではありません。これらの適切 – siliconpi
働いていたと思ういけない、とのように見える - あなたが編集を見てすることができますabcd/browse.phpに渡すと、ブラウザの最後で何が起こっていますか? – Ben
こんにちは@Ben - あなたのブラウザがこのサーバが理解できなかった要求を送信しました。"Edit1に記載されている両方のURLのために – siliconpi