我希望我的网站将以下所有内容重定向到ravisah.in
请帮我这样做。
我的htaccess文件代码
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^ravisah.in[nc]
RewriteRule ^(.*)$ http://www.ravisah.in/$1 [r=301,nc]
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php
ErrorDocument 404 /404.php
答案 0 :(得分:1)
您可以使用以下规则:
RewriteRule ^index\.php$ / [R=301,L]
这会将 /index.php 永久重定向到 / 。
答案 1 :(得分:0)
我认为没有任何解决方案我只需要为网站购买SSL证书。
答案 2 :(得分:0)
使用.htaccess文件进行301重定向
RewriteEngine On
RewriteCond %{HTTP_HOST} ^http://www.ravisah.in [NC]
RewriteRule ^(.*)$ http://ravisah.in/$1 [L,R=301]
RewriteCond %{HTTP_HOST} ^https://www.ravisah.in/index.php [NC]
RewriteRule ^(.*)$ http://ravisah.in/$1 [L,R=301]
**Used for remove www from url**
RewriteCond %{HTTP_HOST} ^www.ravisah.in [NC]
RewriteRule ^(.*)$ http://ravisah.in/$1 [L,R=301]
**Used for https to http**
RewriteCond %{HTTPS} on
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
**Used for remove index.php**
RewriteRule ^index\.php$ / [R=301,L]
对于SSl工具您必须具有SSl证书