Questions tagged as 'htaccess'

2
answers

What better option to protect directories and files in a root folder?

On a web server, I have a folder inside the root folder (public_html) that should be protected. It contains system files, settings, logs, classes and so on ... Generally, what is the best option to protect access to the folder, any file conta...
asked by 26.09.2015 / 22:25
2
answers

Doubt regarding permanent links to posts

In my project, users can post, and I would like each post to have a permanent link so it can be accessed separately. In what I already thought: Create a post.php file that would receive the post id via GET and display the data, a condit...
asked by 21.04.2015 / 22:21
2
answers

How to build friendly URLs, such as Facebook and Twitter.

I have a question, how can I build links like Facebook and Twitter? For example: http://facebook.com/nome-qualquer . I know that .htaccess treats the url in some way, but the question I'm beating is how to load the contents of ur...
asked by 13.03.2014 / 21:21
3
answers

how to treat different index / templates for the same site?

I have 10 distinct html / php templates and via panel (admin) the client can select one of the 10 templates for his site. My question is how to get the website to know which template to open. In the panel I save the selected template in the d...
asked by 18.01.2015 / 20:11
2
answers

Htaccess that directs to https and also to www

I need that when the user accesses with http is directed to https and when it accesses without www redirects to access with www, follows doubts below: I'm using the following code in .htaccess: <IfModule mod_rewrite.c> RewriteEngine...
asked by 09.01.2018 / 14:26
2
answers

URL rewriting in .htacces

I have the following URL: http://<site>/application/views/ambiente_teste/assets-teste/... And I wanted to re-add it to: http://<site>/assets-teste/... I tried the following in my .htaccess: RewriteRule ^assets-teste/?$ /a...
asked by 16.12.2014 / 20:20
1
answer

htaccess that hides only directories [duplicate]

I created a assets directory to put the assets of my project. So far so good, however, I have found that by typing in the URL localhost/project/assets , it shows the directory structure of that folder. In order to prevent this a...
asked by 18.10.2017 / 23:27
1
answer

PHP Built-in and htaccess - Routing System / Friendly URL

I have a .htaccess file for route deviation on the server (production) and a router.php file for route deviation using the PHP 7 Built-in server. php -S 0.0.0.0:8000 router.php However, I would like to use router.php also in production, w...
asked by 19.10.2016 / 20:21
1
answer

Use .htaccess in a directory with files and folders with the same name

My directory is as follows: root/ ├── index.php ├── about.php ├── privacy.php └── about/ ├── brand.php └── history.php I would like that when the user types meusite.com/about , HTACCESS redirects it to the about.php fil...
asked by 23.01.2017 / 20:06
2
answers

How to display an image without an extension through the direct link in the browser?

Example - http://meusite/imagem/001 Result that I do not want, I want to see the image. ÿØÿà�JFIF��H�H��ÿÛ�C� ÿÛ�C ÿÀ�p�"�ÿÄ������������ ÿÄ�7����!1A"Q2a¡Bq‘#3R$CbScðÿÄ�����������ÿÄ�)�������!1A"Q2a#BÿÚ���?�ù¶¨/d99ñI­”s...
asked by 12.09.2016 / 16:51