Questions tagged as 'htaccess'

1
answer

Can denying access to a folder with mod_rewrite be insecure?

I'm thinking of creating a very limited php microframework just for own use, however I came across a situation, most frameworks use a folder called public and on the usually production servers we point this folder with DocumentRoot...
asked by 12.12.2015 / 01:26
1
answer

Redirect extensions and folders with .htaccess

I'm in all ways trying to create a redirect with htaccess and I got it like this: <ifModule mod_rewrite.c> RewriteEngine On RewriteCond %{SCRIPT_FILENAME} !-f RewriteCond %{SCRIPT_FILENAME} !-d Options +FollowSymLinks RewriteCond %{REQUE...
asked by 21.05.2015 / 00:59
1
answer

What does L, R, NC mean in HTACCESS?

I did not understand the operation of the L flag very well. Doubt arose when I was trying to use the following script: #quando vier o "public" na url, reescreve para folder/public RewriteRule ^public/(.*)$ folder/public/$1 [NC] Rewri...
asked by 23.03.2015 / 13:30
1
answer

Redirect all pages to HTTPS minus one in particular

I have the following code in .htaccses to redirect the whole site to HTTPS : RewriteEngine On RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://meudominio.com/$1 [R,L] However, I would like to leave a page out of this r...
asked by 20.12.2014 / 11:51
1
answer

Remove file extension, not to be seen by the user

How would I make the file extension not seen by the user? Example As soon as the user finishes the registration, it will be directed to the confirmacao.php page, but would like the .php extension not to be visible, only co...
asked by 05.12.2017 / 12:34
2
answers

.htaccess with subfolder other than root

I was working with this framework and with this htaccess: structure config/ logs/ www/ app/ bootstrap/ public/ packages/ .htaccess index.php ... vendor/ .htaccess ... htaccess...
asked by 16.01.2014 / 19:23
1
answer

How do I configure .htaccess to accept hyphen in the URL?

I'm customizing the URLs of my site, but .htaccess does not accept URLs with hyphens, for example: postagem/1/criando-efeito-fadeout-com-javascript When I write the title without the hyphens works, but with them not, why? How do I re...
asked by 12.02.2014 / 17:26
2
answers

How to release a sub-directory protected with .htaccess?

I have .htaccess in my test environment developed in CakePHP and the .htaccess has authentication so that not anyone is accessing it. Now I need to release a directory from the site, actually a CakePHP plugin, I need anyone to have acc...
asked by 07.01.2014 / 19:28
2
answers

Targeting all traffic from root to sub folder results in error "403 forbidden" if it does not have "index.php"

The code below works perfectly to direct all site traffic transparently into the www folder: Options -Indexes +SymLinksIfOwnerMatch RewriteEngine on RewriteBase / # Verificar o destino RewriteCond %{HTTP_HOST} ^(www.)?example.com$ # I...
asked by 18.03.2015 / 12:41
1
answer

Rename the url with the contents of the database

How do I rename the url with the contents of the database in PHP using mod_rewrite ? For example: I have in the database a table named urls and I want to use this as follows. Let's assume that on my site I have a b...
asked by 03.04.2018 / 12:19