mod_rewrite/htaccessが機能しない

mod_rewrite/htaccessが機能しない

クライアントサイトで動作するようにmod_rewriteを取得できず、.htaccessファイルを完全に無視します。

私が使用しているLinuxのバージョンが何であるかを100%確信することはできません。 CentOsのようです。

ファイルを確認しましたが、httpd.confmod_rewriteが有効になりました。httpd-vhosts.confファイルをに変更しましたAllowOverrides All

以下はファイルの関連内容ですdata/lampp/etc/httpd.conf

LoadModule rewrite_module modules/mod_rewrite.so

<Directory />
Options FollowSymLinks
AllowOverride None
#XAMPP
#Order deny,allow
#Deny from all
</Directory>

<Directory "/opt/lampp/htdocs">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
#   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important.  Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options
# for more information.
#
#Options Indexes FollowSymLinks
# XAMPP
Options Indexes FollowSymLinks ExecCGI Includes


#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
#   Options FileInfo AuthConfig Limit
#
#AllowOverride None
# since XAMPP 1.4:
AllowOverride All

#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all

</Directory>

#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<FilesMatch "^\.ht">
Order allow,deny
Deny from all
</FilesMatch>

#
# "/opt/lampp/cgi-bin" should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#
<Directory "/opt/lampp/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>

# Virtual hosts
Include etc/extra/httpd-vhosts.conf

# XAMPP
Include etc/extra/httpd-xampp.conf

内容はこれですdata/lampp/etc/extra/httpd-vhosts.conf

NameVirtualHost *:80

<Directory "/opt/lampp/htdocs/mydomain">
AllowOverride All
Order allow,deny
allow from all
</Directory>

<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /opt/lampp/htdocs
ServerName xxx.xxx.xxx.xxx
</VirtualHost>

<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /opt/lampp/htdocs/mydomain
RewriteEngine On
</VirtualHost>

私の.htaccessファイルには次の内容だけが含まれています。

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule ^.*$ htaccess_tester.php
</IfModule>

Apacheのエラーログが見つかりません。どこかに落ちたのは間違いない…!

ベストアンサー1

おすすめ記事