子文件夹中的Apache应用程序
我将我的应用程序放在Apache的子文件夹“subfolder”中,这样我就可以使用url,例如:而不是 我正在使用以下目录配置:子文件夹中的Apache应用程序,apache,.htaccess,webserver,virtualhost,apache-directory,Apache,.htaccess,Webserver,Virtualhost,Apache Directory,我将我的应用程序放在Apache的子文件夹“subfolder”中,这样我就可以使用url,例如:而不是 我正在使用以下目录配置: Alias /subfolder /srv/apache2/htdocs/subfolder <Directory /srv/apache2/htdocs/subfolder> Order allow,deny Allow from all Options All AllowOverride All Require
Alias /subfolder /srv/apache2/htdocs/subfolder
<Directory /srv/apache2/htdocs/subfolder>
Order allow,deny
Allow from all
Options All
AllowOverride All
Require all granted
</Directory>
请注意,错误中的此类链接在路径中不包含“子文件夹”
我缺少什么?在您的站点根目录中。htaccess(即
htdocs/
)使用以下规则:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(?!subfolder/).* subfolder/$0 [L,NC]
在您的站点root.htaccess中(即
htdocs/
)使用以下规则:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(?!subfolder/).* subfolder/$0 [L,NC]
您可以尝试在“子文件夹”目录的公用目录中的.htaccess文件中输入以下内容。我假设您已经在虚拟主机文件中进行了更改
RewriteBase /subfolder (just below RewriteEngine On)
您可以尝试在“子文件夹”目录的公用目录中的.htaccess文件中输入以下内容。我假设您已经在虚拟主机文件中进行了更改
RewriteBase /subfolder (just below RewriteEngine On)