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

#176713
__
Participant

I’m not sure exactly what is causing it, but a “redirect loop” is where you have rewrite rules that create a URL that matches (the same or another) rewrite rule, so the URL is rewritten constantly, without end.

Is that the only rewrite rule you’re using?

~ ~ ~ ~ ~ ~ ~ ~ ~ ~

To address your problem, you have a file at (for example):

/q/sleep-rest.htm

and you want to use the following URL to access it:

mysite.com/sleep-rest/

Correct?

RewriteRule ^/([a-zA-Z0-9_-]+)/?$ /q/$1.htm