Apache 使用htaccess删除URL中的所有子目录
我运行一个ExpressionEngine站点,该站点将加载一个文章页面,而不管在地址栏中键入的子目录名是什么 例如,所有这些地址:Apache 使用htaccess删除URL中的所有子目录,apache,.htaccess,mod-rewrite,redirect,expressionengine,Apache,.htaccess,Mod Rewrite,Redirect,Expressionengine,我运行一个ExpressionEngine站点,该站点将加载一个文章页面,而不管在地址栏中键入的子目录名是什么 例如,所有这些地址: http://hellothere.example.com/health/mental/depression http://cats.example.com/health/mental/depression http://dogs.example.com/health/mental/depression http://www.batman.example.com/
http://hellothere.example.com/health/mental/depression
http://cats.example.com/health/mental/depression
http://dogs.example.com/health/mental/depression
http://www.batman.example.com/health/mental/depression
http://www.1.2.3.4.5.6.example.com/health/mental/depression
将加载example.com/health/mental/depression
显然,这对于SEO来说并不理想,因为我有一个潜在的无限数量的重复URL
我正试图找出如何使用htaccess在example.com之前剥离任何内容,并将其替换为www.example.com
任何帮助都将不胜感激 您不能使用htaccess执行此操作。实现这一点的方法是设置通配符dns记录,以便所有请求(*.example.com)都指向同一服务器 看