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
-
3
votes1
answer283
viewsHow to redirect to a folder and HTTPS simultaneously?
I have a website http://meusite.pt which is a CNAME of http://minhamaquina.amazon.com, where the hosted site is. Only that I needed it to be redirected to the folder meusite from my Amazon machine,…
-
3
votes1
answer701
viewsUse . htaccess in a directory with file and folders of the same name
My directory is as follows: root/ ├── index.php ├── about.php ├── privacy.php └── about/ ├── brand.php └── history.php I wish that when the user typed meusite.com/about, HTACCESS redirects you to…
-
3
votes1
answer2190
viewsForce www and https in url - HTACCESS
Below is the code to force www and https at the url of the page using htaccess, who need it, for me it worked right. Hugs RewriteEngine On RewriteCond %{HTTPS} off [OR] RewriteCond %{HTTP_HOST}…
-
3
votes1
answer343
viewsWhat does this htaccess regex do?
I have this regex: RewriteRule ^www\/login\/?$ login/ [L,NC,R] What does she do?
-
3
votes4
answers318
viewsHow to get the last segment of the path?
URLs de exemplo: content/edit content/edit/ content/edit?q= content/edit/?q= I tried to make the code but it always fails when the url does not have "/" or "?" and if there is "/?" at the end. The…
-
3
votes1
answer206
viewsExtend PHP session using . htaccess
How to extend a session in PHP using . htaccess? I used this code below: php_value session.cookie_lifetime 28800 php_value session.cache_expire 28800 php_value session.gc_maxlifetime 28800 However I…
-
3
votes1
answer673
viewsHow to hide.php displays from link (friendly url)
All right? Please, I need help... Currently, my site presents links as follows: https://site.com/pagina/noticia/2019/ciencia-e-saude/exibe.php?link=página-do-leitor-é-maneira In the…
-
3
votes2
answers128
viewsRules and Exceptions in htaccess
I’m having a hard time setting up some route rules in my .htaccess, I originally have the following (I accept suggestions for improvements): RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f…
-
2
votes2
answers793
viewsApache directing two Urls to the same folder
I have 2 sf2 projects in different folders. When I access them through Urls localhost/projeto01 and localhost/projeto02m go to the same location (project01 even when access /project02). I created…
-
2
votes1
answer114
viewsSpecific Rewriterule case for a URL
I have a .htaccess rewriting Urls and a submenu being created dynamically and need one of these links to be opened in another URL/page other than the rest. It’s like this: RewriteRule…
-
2
votes5
answers5625
viewsURL friendly with . htaccess
I would like some help from you because I have tried a few times but I have not reached the expected result. Need through htaccess, do the following procedure: change the url that is shown in the…
htaccessasked 10 years, 6 months ago Marcos Vinicius 7,188 -
2
votes1
answer48
viewsTime redirection
I have an application that I need to change domain app.com.br need to change to app2.com.br however while I do not change the dns I need a temporary redirect I need that when someone enters any path…
-
2
votes1
answer136
viewsHow to redirect question "q=" from one site to another without changing the question?
I have a mini search site: http://www.cosmo-search.url.ph, and when typed www.cosmo-search.url.ph/search?q=PESQUISA-FEITA-PELO-USUÁRIO I need you to be redirected to…
-
2
votes2
answers166
viewsRouting Codeigniter
I am making a site with administrative area using the Codeigniter Framework. In the administrative area, the user can create new pages for the site. The contents of the page will be saved in a…
-
2
votes2
answers391
viewsUse URL rescrita as array in . htaccess
It is possible to use rescrita with . htaccess and an undefined number of parameters in the URL? In mine. current htaccess I have defined three types of parameters that can be passed in the URL…
-
2
votes1
answer121
viewsAlternative to index.php using . htaccess
How do I make for the .htaccess put another file, other than index.php, as primary, i.e., put a file called home.php and make it work as if it were a index.php. I would also like to know some…
htaccessasked 10 years ago Rodrigo FP 109 -
2
votes1
answer890
viewsRedirect .com.br domain to . com
I have two domains: the main one is . com and the secondary one is .com.br I need to make sure that every time you go www.dominio.com.br it redirects to www.dominio.com, even when it has a…
-
2
votes1
answer214
viewsAllow access to other directories with . htaccess
I have a Wordpress site installed at the root and a service order manager in a folder called /Sistema. The problem is, when I type www.meudominio.com.br/sistema/, is redirecting to the page 404…
-
2
votes1
answer175
viewsFriendly URL does not load content
Well, I’m here with a friendly url problem, I’m doing the routes through the file .htaccess and take the values by $_GET.Only when I enter the url the content is not loaded, the page is always…
-
2
votes1
answer74
viewsEdit url user profile friendly
Good I have the paths of the friendly urls in the htacess file I am viewing the users by the url so by the profile file http://exmeplo.pt/users/carlos But I now wanted to edit the profile of this…
-
2
votes2
answers161
viewsAdd a fixed word to a friendly URL
Good night, I’m doing some research and I’m having a problem passing the value that is written on input to another page where the result will be displayed. Example Url I’m trying to pass values…
-
2
votes1
answer155
viewstransform Query String url to a Readable url for the user
I ever noticed that it was possible to turn a query string into something more readable for the user, like this: real url: site.com/roupas?categoria=vestidos for this (what the user sees)…
-
2
votes2
answers468
viewsRegular expression problem in . htaccess
I have the following rules in my file .htaccess: RewriteRule ^first-login/([a-zA-Z0-9]+)$ ./first-login.php?userKey=$1&step=1 RewriteRule ^first-login/([a-zA-Z0-9]+)?([0-9]+)$…
-
2
votes1
answer186
viewsleave / at the end of the url
I would like to hide the . php extension of website of all pages and get bar at the end example: www.meusite.com.br/pagina/ I would also like to hide the pages that are like Landing pages, that are…
-
2
votes0
answers249
viewserror 500 on server
The errors found were: Notice: A session had already been started - ignoring session_start() getdate(): It is not safe to rely on the system's timezone settings. You are *required* to use the…
-
2
votes2
answers425
viewsRedirect or deny direct access to public folder
I’m using htaccess to access the folders css, js, images who are in /public directly: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^(css|js|images)/(.*)$ public/$1/$2…
-
2
votes1
answer1128
viewsRelease subdirectory through . htaccess
How do I release a specific subdirectory (and all its files) via . htaccess? How do I use "friendly url" and through .htaccess I block everything that does not suit, I would like to know how to…
-
2
votes2
answers650
viewsHow to point all pages of the site to one page?
I am in need of a solution in htaccess that points all pages of the site to a specific page of the type: http://meusite.com.br/pagina1.html -> http://meusite.com.br/index.php…
htaccessasked 9 years, 3 months ago Marcos Vinicius 7,188 -
2
votes1
answer1464
viewsError 500 Request exceeded the limit of 10 Internal Redirects
I’m having a problem with htaccess Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator…
htaccessasked 9 years, 5 months ago Rubens Ventura 301 -
2
votes1
answer592
viewsProblem with form (GET method) and URL Friendly
I have a problem sending a form, because I am using a scheme that changes the pages according to the GET['page'], and I used the user-friendly url to take out all that code to leave only the page…
-
2
votes2
answers9412
viewsCodeigniter . htaccess remover index.php
Starting working with Codeigniter and want to remove the index.php of URLS: example.com/index.php/news/article/my_article The problem is I have the file .htaccess in 3 different locations: This in…
-
2
votes0
answers353
viewshtaccess configuration to capture all GET data from a query string
I rewrote my url rule as follows: RewriteRule ^(.+)$ index.php?path=$1 [QSA,L] In php I get the parameters of $_GET['path'] and configure my controller, action and parameters. $this->controlador,…
-
2
votes1
answer1846
viewsHow to host my angular application
I have the following directories in my angular application: node_modules/ src/ --client/ ----/app/ ----/index.html --server/ package.json file print I would like when the user accesses my site he…
-
2
votes1
answer304
viewsURL friendly with various paramteros in htaccess
i see that some sites like olx, search among others, when sent several parameters in the url is separated these parameters by / or -. For example:…
htaccessasked 9 years, 2 months ago Igor Silva 661 -
2
votes0
answers254
viewsCache: How to use mod_headers
I have a server Nginx in a shared environment where it is not possible to enable the max-age because the same is part of the mod_expires, in which it is only available in a dedicated environment. I…
-
2
votes1
answer289
viewsMerge 2 mod_rewrite conditions into . htaccess
About . htaccess and mod_rewrite understanding absolutely nothing! The situation is as follows, I have 2 projects in different areas: This first project uses the condition below that directs the…
-
2
votes1
answer1823
viewsError Accessing Site in Earth Hosting
I transferred a website to network in an Earth hosting and when trying to access it displays the following error: Not Found [CFN #0005] I’m talking to the support - horrible, by the way (Neto) - and…
-
2
votes3
answers7154
viewsHow to hide directory paths in htaccess url?
How to make all site urls shortened by hiding all directory paths? For example: www.meusite.com/models/scripts/arquivo.php www.meusite.com/view/templates/arquivo.php…
-
2
votes0
answers81
viewsHow to restrict external file access by htaccess url?
I’m studying htacess, and found this article (that helped in a lot of things), where it says the following: Let’s say you wish prevent third parties from accessing certain files and folders on your…
-
2
votes2
answers119
viewsCentos 6 - Codeigniter - HMVC - Not Found
Good afternoon I am developing a system with Codeigniter 2.X, and I use the concept of HMVC. My files are like this: ->system/ .htaccess ->application/ ->controllers ->... ->model…
-
2
votes2
answers279
views.htaccess wildcard subdomain pointing to directory + hash
Very simple to doubt. Redirect by . htaccess containing a wildcard and hash subdomain. Of: http://carros.domain.com/visualizar#123 http://casas.domain.com/visualizar#345…
-
2
votes1
answer627
viewsGeneric Parameter Friendly URL . htaccess
I’d like to ride a URL user-friendly with generic parameters, ie that receive any parameter in any quantity or file. Today I rode the .htaccess so that the file name becomes the URL. File I am…
-
2
votes1
answer92
viewsIs it possible to use Setoutputfilter DEFLATE without caching copy?
I know that the SetOutputFilter DEFLATE has the function of compressing the file to be received by the browser. I used this in my . htaccess to reduce file load time data.js <FilesMatch…
-
2
votes1
answer247
viewsHTACCESS - Directory deletion condition
Good night! I am with the following scenario in an application: I’m redirecting all requests to my index.php and treating URL’s through the application: RewriteCond %{REQUEST_URI} !admin RewriteCond…
-
2
votes1
answer61
views.htaccess import another rule file
Guys, I have the following problem, I have an administrative area where can be registered page redirects, and these redirects are saved in the bank, currently I redirect via PHP, but I would like to…
-
2
votes1
answer3205
viewsError 500 while accessing page using Checkspelling in htaccess
I have several files with image tags, in these images the name of the path has uppercase and lowercase letters, for example: <img src="../../imagens/Botoes/nomeBotao.PNG"> It is not possible…
-
2
votes0
answers1042
viewsWordpress downloads the page and does not display
Good afternoon! I have the following problem, some pages in the WP control panel are downloaded instead of loading normally when I try to access them. This happened after I edited the . htaccess, I…
-
2
votes2
answers161
viewsAlternative URL in PHP
I’m having a hard time creating an alternative, more user-friendly URL for my customers. The real estate system I have generates an alternative address for each of them, example:…
-
2
votes1
answer507
viewsProblem with . htaccess, subdomain
I have on my site (root) a Windows installation, IE, in the public_html folder I have a file . htaccess with: <IfModule mod_deflate.c> <FilesMatch "\.(html|php|txt|xml|js|css)$">…
-
2
votes1
answer1991
viewsIs it possible to use . htaccess with IIS?
Is it possible for me to use the .htaccess with the IIS?