Tag Info

Hot answers tagged

2

For Q1, the - doesn't mean that processing or iteration would be stopped, simply that the URL path would be passed through without any filtering or processing. The file will continue to execute rules until it reaches the end of the file or a rule is met that has the [L] last rule flag appended to it. To clarify then, RewriteRule .* - ...


2

Triying the same and on my search I found that symfony2 frameworks .htaccess file is doing that at least it is stated in the file that it would. I tried to use it in my own setup but didnt work. Maybe that will help you guys somehow. # Determine the RewriteBase automatically and set it as environment variable. # If you are using Apache aliases to do mass ...


1

The simplest method would be: # Redirect to HTTP 404 File/Page Not Found Redirect 404 "/ja/any_posts" Redirect 404 "/ja/all_posts" Redirect 404 "/fr/any_posts" Redirect 404 "/fr/all_posts" Though you could also use: # Redirect to HTTP 404 File/Page Not Found RewriteRule ^ja/any_posts$ - [R=404,L] RewriteRule ^ja/all_posts$ - [R=404,L] RewriteRule ...


1

I found the solution: RewriteRule ^(admin|user)($|/) - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !/subfolder RewriteRule ^(.*)$ index.php?q=$1 [L,QSA] Those rules will rewrite all the root folders to index.php?q=foldername. It will exclude the "admin" and "user" folders.



Only top voted, non community-wiki answers of a minimum length are eligible