I want to write a rule in htaccess that always redirects http://example.com/index.aspx
or http://www.example.com/index.aspx
to http://example.com
.
This is what I have tried so far:
RewriteCond %{REQUEST_URI} ^/index.aspx [NC]
RewriteRule ^(.*)$ http://%1 [R=301,L]
but it's not working properly.
Thanks
您只能使用一个规则:
RewriteRule ^index\.aspx$ http://%{HTTP_HOST} [NC,R=301,L]
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.