Most voted "htaccess" questions
WARNING: if this tag is appropriate, the question is probably duplicate. Do a search on the site before posting. Still, infrastructure configuration does not belong to the scope of the site. It was experimentally accepted a time, but it is no longer the case. The `.htaccess ` file is a configuration file for the Apache web server, allowing configuration settings to be made at a specific level of the directory, overriding the global settings.
Learn more…651 questions
Sort by count of
-
4
votes2
answers2341
viewsHtaccess is not redirecting to 404 error page
I have a .htaccess with the following configuration: ErrorDocument 404 /erro404.html <IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^index/?$ index.php [NC,L] RewriteRule…
-
4
votes4
answers869
viewsHow to install Wordpress Multisite?
I am using the option of multi-sites Wordpress, but is not working as expected. I have enabled and created the subdomains, but returns: Not Found The requested URL /index.php was not found on this…
-
4
votes2
answers716
viewsHow to prevent POST from outside the server?
I’m creating an app and I didn’t want some smart-ass thinking about changing the path of a POST html to send the values he wants, so I used a method in PHP: $referral=$_SERVER['HTTP_REFERER'];…
-
4
votes2
answers1186
viewsBlock access to javascript files
I have a javascript file that makes ajax requests to my API only I do not want anyone to discover her link there is some way to block access to this file ? If there is no way to release so only the…
-
4
votes1
answer2336
viewsHow to redirect via . htaccess?
I’d like to redirect 15 to 20 urls static from one site to another url, type: http://meusite.com.br/home1.html for http://novosite.com.br http://meusite.com.br/home2.html for http://novosite.com.br…
htaccessasked 9 years, 5 months ago Marcos Vinicius 7,188 -
4
votes2
answers566
viewshtaccess hide MVC model parameters
I have the following URL: http://192.168.1.67/plays/mvc/index.php?route=profile&user=mikas.28 On which route = PAGE and user = USERNAME.USERID I have the following htaccess Options -Multiviews…
-
4
votes1
answer2084
viewsSet Laravel to Standard Level/Directory
I have an app Laravel and do the deploy from git to my server. But the problem is that the server always plays deploy inside the public folder, and the Laravel originally is to stay one level above.…
-
4
votes2
answers2013
viewsHtaccess - redirecting the domain
I had Ubdomain "B2b".dominio.com.br and now I switched the files to "catalogo".dominio.com.br I want an htaccess rule That when you enter the http://b2b.dominio.com.br/etcqlqr-coisa/qualquercoisa No…
-
4
votes1
answer1018
viewsCodeigniter 3 - HMVC - Problem with routes, Not Found or Failed to Load Session.php
My scenario is this:: I am using Codeigniter 3 with HMVC, while doing only local development, I had no problems with XAMPP with Windows, I went up to my test server which is an Ubuntu Server and…
-
4
votes1
answer1455
viewsHTTP and HTTPS redirection with exception
I have a website on http and added a certificate SSL. I need a script via htaccess that redirects the entire site to https (301 redirect), but a single specific page of the site will need to be…
-
4
votes1
answer195
viewsHow to optimize html and css files?
Optimization does not compress html and css files. After compressing them into minifier html and minifier css and putting the following code in htaccess(see below) still not accusing the compression…
-
4
votes2
answers629
viewsMultiple Access-Control-Allow-Origin domains
I have a page that serves some data in JSON format based on the data received from the database, but I need to free access so that the mobile version can also obtain such data, as I can put more…
-
4
votes1
answer250
viewsHow do I upload a file larger than 10MB without having access to php.ini?
Here’s what it is: My free file hosting gives me access to see information from the php.ini file, but I can’t modify it, I’ve tried creating a php.ini folder in the php.ini folder htdocs but it…
-
4
votes1
answer564
viewshow to hide subfolders from url through . htacess
Hello! how to change a url through htacess. wanted this url: http://localhost/site/product/view/Mi00OTI/golbolaver remain so: http://localhost/site/view/Mi00OTI/golbolaver…
-
4
votes1
answer1661
viewsRedirect HTTP to HTTPS on . htaccess with Let’s Encrypt
I cannot in any way test whether my address is in https when Let’s Encrypt is installed... Some charitable soul could help me redirect to https? I have installed in my hosting Uolhost (Platform:…
-
4
votes0
answers82
viewsHow to optimize the site according to analysis response?
I recently blogged for my wife, https://danielafolle.com.br/ which I am now working to optimize the response time of the site. I’m using the Pagespeed Insights Google to base if I’m progressing on…
-
4
votes1
answer222
viewshtaccess that hides only directories
I created a directory assets in order to place the Assets of my project. So far so good, however, I found that when typing in the URL localhost/project/assets, it shows the directory structure of…
-
3
votes2
answers592
viewsHow 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 the .htaccess treats the url in a certain way, but the question I’m…
-
3
votes1
answer689
viewsFree access to page 404.html with . htaccess
I am having a problem when trying to free access to 404.html page through my . htaccess, always gives Internal Server Error. How should I apply a rule to only 404.html is released for direct access?…
htaccessasked 10 years, 11 months ago Rafael Alexandre 2,110 -
3
votes1
answer237
viewsAjax returns error after modifying htaccess
I modified the .htaccess with a rule for the url to be passed as the GET parameter and I handle everything on index.php: Options +FollowSymLinks RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d…
-
3
votes1
answer91
viewsUser-friendly URL with Boilerplate
I’m using Boilerplate to have a base template for use. But I’m trying to use friendly Urls on it, but I can’t.. I’ve tried several codes, the latest is this: RewriteCond %{REQUEST_FILENAME} !-d…
-
3
votes1
answer90
viewsConfigure N levels in htaccess
On the site we have the product area where there may be N levels and sub-levels of categories. htaccess is currently set to accept 2 levels: RewriteRule…
-
3
votes2
answers201
viewsURL rewriting in . htaccess
have the following URL: http://<site>/application/views/ambiente_teste/assets-teste/... And I wanted to rewrite it for: http://<site>/assets-teste/... I have tried in my . htaccess the…
-
3
votes3
answers235
viewshow to treat different index/templates for the same site?
I have 10 distinct html/php templates and via panel (admin) client can select one of 10 templates for your site. My question is how to make the site know which template to open. In the panel I save…
-
3
votes2
answers589
viewsUser friendly URL does not retrieve variable
I’m trying to make the Urls on my site friendly. URL friendly http://localhost/mg/artista/10 .htaccess <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{SCRIPT_FILENAME} !-f RewriteCond…
-
3
votes1
answer3027
viewsHow to free access to specific FOLDER or FILE using . htaccess?
I have a . htaccess in my development environment. Now I need to release a directory of the site, actually a specific PHP file. I’m using this code on. htaccess, I am releasing several extensions,…
-
3
votes3
answers354
viewsProblem with search and url friendly
Good night, I have a search that is working well, I’m only now having a problem when someone writes a word with accent or two words separated by space, breaks my url. I’d like to know how I can…
-
3
votes2
answers301
viewsDoubt 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. What I’ve already thought: Create an archive php post. that would receive the id…
-
3
votes2
answers3046
viewsDots and accents in mod_rewrite Urls
I noticed that many systems that use mod_rewrite (or equivalent) usually do not support Urls with accents, usually they replace the characters as dot (dot) by hyphen (-) and accents for their…
-
3
votes3
answers2002
viewsBlock access to pages containing ". php" with HTACCESS
I want to block direct access to files that end with the extension .php. Suppose I have a page called teste.php. If the user tries to access it by teste.php it will receive a 404. The only way for…
-
3
votes1
answer1078
viewsHow to get PATH_INFO on Nginx when we use rewrite (friendly url)?
I created a .htaccess in the briefcase /var/www/project/: <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond $1…
-
3
votes1
answer538
viewsHow do I direct every request to a subfolder? (HTACCESS)
I have tried several tutorials and none worked beyond the index.php. Use the LOCALHOST and I intend that all requisition, of any kind, example: localhost:8080/teste.php…
-
3
votes1
answer1829
viewsHide domain directory using htaccess or cakephp router
I am having trouble creating a setup on . htaccess to hide a folder from my site. My domain has the following structure: www.site.com.br/cake , where are the files and folders referring to the…
-
3
votes1
answer112
viewsHow to block internet explorer access?
How can I block my site from being accessed by Iternet explorer via . htaccess? I’ve tried codes like: RewriteEngine on RewriteCond %{HTTP_USER_AGENT} "MSIE [6-8]" [NC] RewriteRule ^(.*)$…
-
3
votes1
answer886
viewsAdditional GET parameters does not work with htaccess
I am developing a dynamic web site m pages and url friendly, my problem is the following: When I put the id on the link to view the details of the property <a href="/imovel?id<echo…
-
3
votes2
answers730
viewsWhat 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 must be protected. It contains system files, settings, logs, classes and etc... In general, what is the best option to…
-
3
votes2
answers4716
viewsHow to force HTTP access (Unsafe)
When accessing https://domain.com or https://www.dominio.com, the below security error is displayed: I do not have SSL certificate and have no need at this time. When trying to force redirect to…
-
3
votes1
answer211
viewsURL rewriting with "+" sign (same as Google+) . htaccess
I’d like to write a rule in . htaccess with Rewriterule using the plus sign (+) for a Google-like url, like this: meusite.com.br/+alguem be interpreted meusite.com.br/? track=someone or…
-
3
votes1
answer31
viewsWhy isn’t the style sheet being loaded?
I’m trying to use urls amigáveis but I am having some problems in the learning process. The problem now is that the page does not return the page styles. Options +FollowSymLinks RewriteEngine on…
-
3
votes1
answer226
viewsTreat request redirected by Htaccess
I’m studying about routing, trying to (re)create a routing solution of mine. I’ve always used the following .htaccess to redirect my requests: RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f…
-
3
votes1
answer1865
viewsRedirecting a domain to a subfolder without changing the URL, but not allowing otherwise?
I have the following problem, I have an application with the following structure: app - Folder to store project files as controllers and models. public_html - Stores public documents on the web,…
-
3
votes1
answer318
viewsRedirect all media requests(css,js and images) with htaccess
I am building an MVC application and was having some problems with the file path css,js and images no html... I was given a solution to use the tag <base> to define the path that all html…
-
3
votes2
answers1909
viewsBar at the end of url with . htaccess
I need to add a bar (/) to the end of the url using . htaccess. My current . htaccess is like this: <IfModule mod_rewrite.c> Options +FollowSymLinks RewriteEngine on RewriteCond %{HTTP_HOST}…
-
3
votes1
answer875
viewsRewrite module in . htaccess for subfolders
I have an application in AngularJs with html5 enabled, which makes me need to use the module rewrite apache so there is a correct URL conversion. I have no problem using this when accessing the…
-
3
votes1
answer112
viewsChange link with . htaccess
I have the following link http://127.0.0.1/site/noticia/12(cod_da_noticia) I wonder how I can leave the link like this http://127.0.0.1/site/noticia/12(cod_da_noticia)/queria colocar o titulo aqui…
-
3
votes1
answer420
viewsRemove subdirectories with htaccess
I have an example.com website that had a subdirectory called /lojanova. This entire site has been migrated to the root of the main directory: "/". For google there are still some images and files…
-
3
votes2
answers865
viewsHow to view image without an extension via direct link in the browser?
Example - http://meusite/imagem/001 Result I do not want, I want to view the image. ÿØÿà�JFIF��H�H��ÿÛ�C� ÿÛ�C ÿÀ�p�"�ÿÄ������������…
-
3
votes1
answer1220
viewsPHP Built-in and htaccess - Route System / User Friendly URL
I have a file. htaccess for route diversion on the server (production) and a router.php file for route diversion using PHP 7’s Built-in server. php -S 0.0.0.0:8000 router.php However, I would like…
-
3
votes2
answers2055
views -
3
votes0
answers37
viewsHow does the "Rewriterule" command work?
I’m studying about the file .htaccess and how page forwarding occurs. Reading about URL friendly I had doubts about the command RewriteRule, more specifically to its operation, they come just below.…