且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

htaccess的重定向URL是否包含特定字符串

更新时间:2023-02-26 10:54:12

 的RewriteCond%{REQUEST_URI} FOOBAR
重写规则。*的index.php
 

一些变体

How would I write a htaccess redirect rule if the URL contains a certain word

e.g. If contains "foobar" then redirect to index.php

Any help greatly appreciated

RewriteCond %{REQUEST_URI} foobar
RewriteRule .* index.php

or some variant thereof.