Options +FollowSymlinks
RewriteEngine On
That’s the default minimum. Nothing to say, moving along.
RewriteRule ^(testes) – [L]
(1) Since you just want to match one directory (I assume?) you don’t need the parentheses
(2) Are you sure you need this rule? Would be matched by any the following rules?
#to not allow hotlinking to images
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\\.)?mysite.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\\.)?mysite.dev [NC]
RewriteRule \\.(jpg|jpeg|png|gif)$ - [NC,F,L]
This won’t work. RewriteConds are anded by default. So it is: if RewriteCond 1 holds and RewriteCond 2 holds and RewriteCond 3 holds …
Since the three rules are mutually exclusive this will never happen, you need to make them or instead of and, which you can do with the [OR] flag.
Also, you can remove the parentheses around the s from http(s)?
Lastly, don’t forget to escape all dots in there.
#to not allow hotlinking to images
RewriteCond %{HTTP_REFERER} !^$ [OR]
RewriteCond %{HTTP_REFERER} !^https?://(www\\.)?mysite[COLOR="Red"]\\[/COLOR].com [NC,OR]
RewriteCond %{HTTP_REFERER} !^https?://(www\\.)?mysite[COLOR="Red"]\\[/COLOR].dev [NC]
RewriteRule \\.(jpg|jpeg|png|gif)$ - [NC,F,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .? public/index.php [L]
Nothing to add.
RewriteCond %{REQUEST_URI} !^/public/.*$
RewriteRule ^(.*)$ /public/$1
See post #8
I’m not a fan of this public/ directory. But it’s not wrong.
I would however stay clear from the :redhot: (.*) :redhot: atom and change it to
RewriteCond %{REQUEST_URI} !^/public/.*$
RewriteRule .? /public%{REQUEST_URI}
That is a bit faster and nicer IMO.
RewriteRule ^public/.*$ /public/index.php [NC,L]
[/QUOTE]
Why? The block with !-f and !-d already catches this. You can remove this last block.