2014-01-19 50 views
1
<IfModule mod_rewrite.c> 
    Options +FollowSymlinks 
    Options +SymLinksIfOwnerMatch 
RewriteEngine On 
RewriteCond %{HTTP_HOST} ^www\.example\.am [NC] 
RewriteRule ^(.*)$ http://example.am/$1 [L,R=301] 
</IfModule> 

为什么不工作,我补充说,在中端/etc/httpd/conf/http.conf,我确信国防部重写不工作的CentOS

<Directory /> 
    Options FollowSymLinks 
    AllowOverride All 
</Directory> 

<Directory "/var/www/html"> 

是因为我的网站在/ srv/www/domain/public_html?

+0

是您的网站www.example.am,并且在其虚拟主机定义中定义为这样? –

+0

不,我把我的网址,但我有我的网址以前它仍然没有工作? – user3211562

+0

也许mod_rewrite没有加载?不要这样使用IfModule! – covener

回答

-1

移动国防部重写代码.htaccess文件在Web服务器的根目录(即/ SRV /网络/域/的public_html服务器)

重新启动Apache服务(或nginx的取决于你是什么样的服务器使用),并应该将mod重写应用到您的网站。