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
-
0
votes1
answer105
viewsTransform these Web.config rules into . htaccess
Good night, I’m needing to move these parts from a web.config to . htaccess, but I’m having a lot of questions. <rule name="Regla 1-1"> <match url="^camera/pictures/(.*)_small\.png$"…
-
0
votes1
answer198
viewsRedirect www htaccess with segment in url
Where my site is hosted, I am using the . htaccess and on it has a condition to remove the www and direct to the main page without the www. <ifModule mod_rewrite.c> Header set X-Frame-Options…
-
0
votes1
answer94
viewsSitemap.php for Sitemap.xml
Can anyone help me? I made a file "sitemap.php" all ok, only I want it to be accessed in "sitemap.xml" also. My . htaccess; <IfModule mod_rewrite.c> DirectoryIndex index.php RewriteEngine on…
-
0
votes1
answer119
viewsHow to release a URL and Query String level with or without via . htaccess and others have an error 404?
With . htaccess I need to release a url level to block the others with error 404 being: /example (can) /example/ (can) /example/anything (can’t) RewriteEngine On RewriteRule %{REQUEST_FILENAME} !-f…
-
0
votes2
answers200
viewsurl friendlies category subcategory
With the category works more as I put the subcategory too? produtos/nome-categoria/nome-subcategoria <IfModule mod_rewrite.c> RewriteEngine On #aqui criamos uma condição para que os arquivos…
htaccessasked 7 years, 4 months ago Wagner Martins Bodyboard 698 -
0
votes1
answer178
views.htaccess does not work the rule
I could get my urls like this? produtos/nome-categoria ptodutos/nome-categoria/nome-subcategorias 'Cause I can’t do it, look how I’m making the rule in . htaccess <IfModule mod_rewrite.c>…
htaccessasked 7 years, 4 months ago Wagner Martins Bodyboard 698 -
0
votes0
answers30
viewsMultiple Framworks within a separate folder domain
I have a framework, where I want to divide it into several frameworks (MVC) per folder at the root of the domain. At the root of the domain I have no file, there are folders where I have file at the…
-
0
votes1
answer833
viewsUsing browser cache does not work
The Google Pagespeed tool is displaying error: Take advantage of browser cache. My website: buscaempresas.com.br. I activated the modules on my server expires and headers, then I added in htaccess…
-
0
votes1
answer331
viewsSplit into URL AMIGAVEL without creating folder
Hello, I am running a website and starting to work with friendly Urls, with this structure I can perform the procedure normally and redeem the values. Now I would like to create divisions in the…
-
0
votes3
answers346
viewsRedirect file access via htacess
Good when user type some file with the .txt I have to send it to an authentication file called download.php Example, if user type www.meusite.com.br/documento.txt I have to redirect him to the…
-
0
votes2
answers44
viewsdirect with htaccess
I have a project where when the user type the site with www, it gives error. I checked the server and there is no htaccess in the root folder. With this, I would like to know how to make the user…
htaccessasked 7 years, 3 months ago user24136 -
0
votes1
answer77
viewsHtaccess - Site Friendly URL at the Root
How to make URL friendly open at the root. I have the file workVer.php? id=1 I’d like it to open like this: www.site.com/87190-first-test Doesn’t work: RewriteRule ^([^/]*)\$ /trabalhoVer.php?id=$1…
-
0
votes0
answers564
viewsForbidden for any htaccess
I’m using the Uniform Server portable server, I’ve already decoded the line to activate apache mod_rewrite, but I’m getting the error 403 Forbidden for any file . htaccess to use, this first is from…
-
0
votes2
answers307
viewsHow to create an exception in htaccess for locking folders
I have a folder that contains some Pdfs and would like to block the folder access by the url (eg www.site.com/pdf) so I got the following command deny from all but when I call PDF inside an iframe…
-
0
votes1
answer1113
views.htaccess does not work
Hello, I already use these rules. htaccess and never gave me problem, so much so that use in other providers currently, I wonder if the version of apache or php on the hosting server hinders the…
-
0
votes1
answer305
viewsRedirect URL to mobile version with . htaccess
I’m making the mobile version of a website and I need it to redirect any page to its mobile version: Ex: If the accessed page is: https://www.website.com.br/seguranca should redirect to…
-
0
votes1
answer116
views.htaccess on Plesk Linux or Windows
My file . htaccess does not work , I saw this help link but how to adjust in my . htaccess ? *The site opens goes through index.php but when it is redirected to the login gives No input file…
-
0
votes1
answer250
viewsCheck if file exists through . htaccess URL
I have the following situation, I need to check if a particular file exists, based on the URL I am trying to access, if it exists displays normally, otherwise redirects to an error page. For…
-
0
votes1
answer322
views301 conditional forwarding by IP to another domain
I would like to redirect all users who access a particular page from one domain to the same page from another domain, except myself, I thought of using conditional IP forwarding from next way…
-
0
votes1
answer71
viewsRewriterule conflict in htaccess
I’ve done several searches but I haven’t found the solution to my problem. I have an htaccess in the following format: RewriteEngine On RewriteRule fotos$ arc_fotos.php RewriteRule fotos/$…
-
0
votes1
answer210
viewshtaccess friendly URL does not work in Plesk?
I created the file .htaccess and included it in the root of my site with the following code: RewriteEngine On RewriteRule ^([a-zA-Z0-9_-]+)$ teste.php?u=$1 RewriteRule ^([a-zA-Z0-9_-]+)/$…
-
0
votes2
answers289
viewsRedirect with . htaccess if url contains string
I am working on an application using Angular4 and PHP, for the Angular URL to work, I need to use a certain configuration in .htaccess to direct to the index.html, thus: <IfModule…
-
0
votes1
answer798
viewsError "X-UA-Compatible HTTP header must have the value IE=edge, was IE=Edge,Chrome=1"
I ran W3C HTML Validator to check for any problems and this is the only error I have: //prntscr.com/gj1z22 "X-UA-Compatible HTTP header must have the value IE=edge, was IE=Edge,Chrome=1" I didn’t…
-
0
votes3
answers2388
viewsHow to change the home page of the directory through . htaccess?
I have a website that when accessed, you are redirected to the page index.php, but actually I want it to be redirected to the page inicio.html. How can I change that?…
-
0
votes1
answer58
viewsSetting Domain for Wordpress Page Structure
I have a Wordpress installation with several "sites".. I will explain: site-main.com/ -> opens a blank page (index.php, with no redirection in options/reading) site-main.com/site-um ->…
-
0
votes1
answer74
viewsRedirect a url into a folder without displaying name
I have a local url: http://localhost/project/view/ and http://localhost/project/view/cadastro.php would like to have htaccess remove /view/, example: http://localhost/project or…
-
0
votes1
answer80
viewsreplace hyphen with underline htaccess
How to replace the hyphen next to the number by underline in this URL(htaccess). www.site.com.br/post/77-eu_tu_eles
-
0
votes2
answers1179
views.htaccess change extensions . php and . html automatically?
I’m using my htaccess like this # Hide .html or .php extension ## External Redirect RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.php [NC] RewriteRule ^ %1 [R,NC] ## ## Internal Redirect…
-
0
votes1
answer55
viewsUser friendly URL with folder
And I have the following question: It is possible to transform this url: http://localhost/project name/usercenter/index.php? user=home In: http://localhost/newera/user/home Can you do that? I tried…
-
0
votes1
answer746
viewsHide folder path with . htaccess
Olar. I’m working with a . htaccess file but I’m having a hard time getting what I need. I have the mastery site.com.br/panel/view/painel_de_access.php and would like to convert this url into…
htaccessasked 7 years ago Conrado Saud 107 -
0
votes1
answer613
viewsURL and PORT forwarding in . htaccess
Following, I have a URL: http://ip_do_server/fop2 What I wanted to do is, when someone enters this url, apache redirects to the following address: http://ip_do_server:81/mesa_contact/login I’ve…
-
0
votes0
answers20
viewsI can’t get url in php using htaccess
This is the code I’m using, but it doesn’t send the url to the shoes.php file, but I put the index.php file and it sends. How to solve this? That is, how to send the URL to the shoe.php file?…
-
0
votes1
answer25
viewsWebsite redirecting to url with / at the end
When I enter my site www.exemplo.com It redirects to www.exemplo.com/ How to solve this? Follow my . haccess Options -Indexes #Ativamos a RewriteEngine RewriteEngine on RewriteCond %{HTTPS} !=on…
-
0
votes1
answer479
viewsProblems with mod_rewrite in Apache
I enabled mod_rewrite in local Apache, but it doesn’t seem to be working. I’m using Linux Deepin 15.5 and the process I did was: sudo a2enmod rewrite The answer I got: Enabling module rewrite. I…
-
0
votes1
answer76
viewsError while searching in form with Friendly URL
I got the following .htaccess which so far has worked perfectly: <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule…
-
0
votes1
answer46
viewsCreating Friendly URL I don’t know how to do
I have a website and index.php and where to register and login. Watch some videos lessons but all of them do the explanation using index as an example so you can pick up the url and work it with php…
-
0
votes0
answers181
viewsHow to block and remove a range of Ips from a city/state in . htaccess?
wanted to temporarily block some states of Brazil not to access my site, as I can do this through htaccess. In fact, the hardest thing is to discover this range of Ips from each state or city? Thank…
-
0
votes1
answer200
viewshtaccess - Rewrite URL with . htaccess inside a subdirectory
I am trying to rewrite a URL where the . htaccess file is inside a subdirectory. Current URL: localhost/Development/Projects/redirect/index.php URL I’d like to use: localhost/redirect/index.php My…
-
0
votes1
answer57
viewsSimilar rewriterule problems in htaccess URL
I have two Urls http://localhost/odata/contact http://localhost/odata/en They are different URL that lead to different . php files, so I did my htaccess: RewriteRule ^entre-em-contato…
-
0
votes1
answer39
viewsboquear directories and files with . htaccess
I don’t know much about .htaccess and I came across a project where it blocked some images that I climbed into an img folder of the project. RewriteRule ^(css|js|img)/(.*)$ statics/$1/$2 [L] But…
-
0
votes0
answers52
viewsTimthumb-friendly URL
Today, I use this rule to create friendly URL and use MVC in my projects: RewRiteRule ^(.*)$ /index.php?url=$1 [QSA,L] In this case, I use Timthumb to generate cached images in PHP, and it returns…
-
0
votes1
answer239
viewsROUTE scheme . htaccess
I have the following URL: http://localhost/devops/json/index.php and I wish to have access to the index of this page: http://localhost/devops/json/ I wish the display of index.php be hidden…
-
0
votes3
answers585
viewsHow to use Rewrite to include subdirectory and Slug?
Edition: I refined the information based on the answers and questions of the employees. internal urls in menus: a href="/cursos/matem/? Slug=Algebra-linear">Mathematics Algebra a…
-
0
votes1
answer654
views.htaccess Internal Server Error
I want to make my Urls more friendly and am using the .htaccess for that reason. The problem is that it is returning me an Internal Server Error, and I could not identify where my Rule error is.…
-
0
votes0
answers36
viewsControl access on two Urls with . htaccess
I have the folder of login from my website www.meusite.com.br/login and that. after logging in. goes to the www.meusite.com.br/painel. The point is, I need to apply a rule to the login and another…
-
0
votes0
answers286
viewsHow to remove htaccess redirect to public folder
The settings of my htaccess to force the SSL this way as follows: # NA PASTA RAIZ Options -Indexes <IfModule mod_rewrite.c> <br> RewriteEngine on<br> <br><br>…
-
0
votes1
answer570
viewsHow do I redirect . htaccess from a subdomain to the main domain?
I have a domain (www.dominio.com.br) and a subfolder (www.dominio.com.br/folder) and would like to redirect all links from that folder to the domain. Examples are: www.dominio.com.br/folder…
-
0
votes1
answer69
viewsProhibit other sites from using my content
Hello, I am trying to develop an htaccess code that prevents other sites from using my content. I tried this, but without success, if I type in the browser given file/link it is inactive even for…
-
0
votes1
answer51
viewsSite redirection error
My website always redirects from www.idealnutri.com/magnesio-dimalato for www.idealnutri.com/magnesio-dimalato/ (WITH BAR AT THE END). Why? How to know what is causing this redirection? NOTE: I…
-
0
votes1
answer78
viewsHow to capture form field with . htaccess?
I’m making my website url friendly, however, I’m having trouble capturing the form search field with .htaccess. All my attempts give 404 error. Form: <form action="busca" method="post">…