Trouble redirecting all pages in a folder to a page at root level

前端 未结 1 1319
情书的邮戳
情书的邮戳 2021-01-22 14:08

I\'ve searched, tried various examples, and none, other than creating an explicit list of redirect statements seems to work.
The biggest issue I have is that, although I h

相关标签:
1条回答
  • 2021-01-22 14:34

    I wouldn't bother searching for cases inside the match string for this kind of thing if I could avoid it - have you tried just specifying the RedirectMatch in lowercase, and appending [NC] to the end of every line? (that will tell mod_rewrite to ignore case and match regardless, which may save you some time)

    if you have collections of similarly-formatted rewrites, why not group them together with one particular set of rules for each? That way you could cover, for example, all incoming URLs with one subdirectory with one rule, and all incoming URLs with a single subdirectory one with another rule. If nothing else, it could help simplify viewing the .htaccess file :)

    (Take everything I suggest with a massive dose of salt, I'm still getting to grips with the black magick of mod_rewrite myself)

    0 讨论(0)
提交回复
热议问题