apache上的htaccess重定向


htaccess redirects on apache

我是.htaccess的新手。

我正在做一个项目,在这个项目中,我需要每隔15天显示一个不同的URL。

例如"mysite.com/S1/folder1",当我在地址栏中输入此URL时,我可以看到index.html内容位于"folder1"内。

现在我想在15天后显示来自相同"folder1"的相同"index.html",但地址栏中的URL会有所不同,例如"mysite.com/S1/any-other-name"。有可能吗。如有任何帮助,我们将不胜感激。

谢谢,Shailendra

在mysite.com DocumentRoot文件夹中尝试使用this.htaccess

RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_URI} !^/?(S1/folder1)/
RewriteRule ^S1/(.*) S1/folder1/

如果您请求以S1/开头的内容,它会将您重定向到S1/folder1