Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other How to remove subdirectories using mod_rewrite in .htaccess Reply To: How to remove subdirectories using mod_rewrite in .htaccess

#176731
ewisely
Participant

The code works like magic!!


  RewriteCond %{THE_REQUEST} /q/([\w-]+)\.htm
  RewriteRule ^.*$ /%1 [R=301]

But could you explain a little more about what the code does, so that I can learn how to use %{THE_REQUEST}, \w- and /%1 which look totally Greek to me. Thank you very much. :)