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

#170944
ewisely
Participant

Hi traq,

RewriteRule ^([A-Za-z]+)/$ /cat/play/$1.html [L]

This example works for all files under the same category. Sorry. Was my mistake. Because I only created one file for testing at first. Then I tried creating more files under a single category, your code worked perfectly. Yup, you got what I want. I completely understand what you mean. Thank you so much for your patience in explaining.

By the way, I’ve stumbled upon a code like this:

RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$

Could you explain to me what this line of code is exactly doing? Appreciate that.