我也一样 但是.htaccess
我没有使用这些行
RewriteEngine On
RewriteCond %{HTTP_HOST} ^one\.domain\.com
RewriteRule ^(.*)$ /folder/$1 [R=301]
到/ etc / apache2 / sites-available / default。
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride All // I even changed None to All
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All // I even changed None to All
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride All
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
RewriteEngine On
RewriteCond %{HTTP_HOST} ^one\.domain\.com
RewriteRule ^(.*)$ /folder/$1 [R=301]
</VirtualHost>
重新启动apache2之后,当我浏览one.domain.com
,Mozzila,IE Chrome时没有响应,但是Safari出现错误
由于它是301,因此您要告诉浏览器重定向到仍然通过您的主机条件的one.domain.com/folder。在重定向2上的意思是您位于页面one.domain.com/folder/folder
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句