New answers tagged

1

A RewriteRule only matches the file path. You can't include part of the domain name in the rewrite rule because the rule will never match it. To match something at the start of the path, use the "starts with" regex operator: ^. To ensure that you are not matching anything in sub-directories, make sure not to match any slashes in your pattern. [^/...


1

Yes, you can just have the RewriteCond / RewriteRule directives. You do not need to repeat the <IfModule mod_rewrite.c> wrapper or the RewriteEngine directive. You only require the <IfModule mod_rewrite.c> wrapper here if your directives are "optional" to the running of your site and you intend to copy these same directives verbatim on ...


Top 50 recent answers are included