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
-
2
votes1
answer484
views.htaccess with friendly URL that allows use of the GET method
Hello, my system makes use of user-friendly URL, however Mercadolivre API authentication returns to my system using ?code=XXXX, what I need is for the site to work in a hybrid way, both with the…
-
2
votes2
answers453
viewsChange the home page via htaccess
People when accessing my site apache automatically loads the page index.php. It is possible to change this in the htaccess? I want him to always search the page Login.php.…
-
2
votes3
answers807
viewsForce url forwarding with htaccess password
I need to test a site that I am creating and for that I will let some people access it, I just want to leave access to a specific url that opens the login of the site.…
-
2
votes1
answer197
viewsDirect with htaccess without changing the url
Colleagues. I have a system that is inside the following directory. www.site.com.br/crm/system/ I would like that when typing www.site.com.br/crm, it was directed to the system folder, but without…
-
2
votes0
answers23
viewsLocking a directory to everyone but the local server
Guys I use the Jquery Autocomplete plugin, and inside my server folder, I have a folder called Search, with several php files. I wanted to know how to block this folder, so that only my server has…
htaccessasked 8 years, 3 months ago Hugo Borges 5,294 -
2
votes1
answer79
viewsHTTPS in wordpress
I bought a certificate and passed my http url to https in wordpress. I used the following ways: Go to "Settings" of your Wordpress, in "General" change the "Address Wordpress (URL)" and "Website…
-
2
votes1
answer320
viewsHow to create a user friendly URL with undefined number of parameters
Hello, would anyone know how to do this regular expression in . htaccess? I need to make the URL pattern friendly in this format: http://dominio.com.br/usuario/joao.json…
-
2
votes1
answer61
viewsFunction valid for all pages
It is possible to set a function for all pages without using include() in all of them? Ex: I have a secret directory ../seg/staff/login/ and want to define which user with permission level less than…
-
2
votes1
answer385
viewsProblems with HTACCES url - 301 redirect does not work on a page
I did 301 redirects of some of the url’s of my site recently and started giving the image problem: My . htacces is like this: RewriteEngine On Options All -Indexes RewriteCond %{SCRIPT_FILENAME} !-f…
-
2
votes1
answer113
viewsLink friendly with htacess
I made some settings in mine htacess. Check her out: Inside of my briefcase www I have a System folder and inside it I have a file called Login.php. I set up forever I type 127.0.0.1 apache always…
-
2
votes1
answer61
viewsStarting with . htaccess
Hello; I’m trying to create friendly Urls for a site, but I’m not succeeding in several examples I’ve tried online. I think my problem is in the way I should redirect the structure of my site, I own…
-
2
votes1
answer2080
viewsHTACCESS - Subdomain
Does anyone there know how to set up htaccess? I need it to work with the subdomain, and not to show the main domain in the address bar when the subdomain is open. Ex of how you are now:…
-
2
votes2
answers931
viewsRedirect file to URL via . htaccess
I am using UOL Host for my website and am having problems redirecting the homepage to a subdomain I created. Researching how to do this, I found that the way to do this would be: Redirect 301…
-
2
votes1
answer109
viewsHow to redirect url with query with . htaccess?
I have the following problem, I need to redirect to the following url: site/nossos-socios.php?termo=teste for site/nossos-socios/?q=teste I need you to have the question before q=, I tried using the…
-
2
votes2
answers397
viewsProblems with HTTPS and WWW Redirection
I’m struggling with something, I have various conditions to meet in mine. htaccess but I can never answer them at once, just once or twice. I have a project in Laravel on the way…
-
2
votes2
answers1177
viewsCode to Leverage Browser Cache Leaves the Site Offline
Well, I’m having a problem getting the blessed "Enjoy Browser Cache" out of Pagespeed Insights. The site I’m doing this for is Wordpress. The entire internet indicates the same code to be inserted…
-
2
votes2
answers280
viewsHow to block directory files recursively?
I am trying to block all files from a particular directory except for .js , .jpg , .css , .gif , .png. I have this code, but it’s not working the way I want it to: <Files ~…
-
2
votes1
answer369
viewsHtaccess Login and Password
I’m having a problem, I have a directory of different files type csv, xls, pdf, docx... I wanted that person. h that put in the browser the file link did not have access to it, only those who made…
-
2
votes1
answer136
viewsRedirect 301 to specific urls
How do I do in htacess redirect 301 ? But in specific urls, I changed my domain, and migrated the posts for example: meusite.com.br/article/article name meusite2.com.br/article/article name Make a…
-
2
votes2
answers166
viewsHow to make my URL more user friendly?
I have the following URL: www.site.com.br/www/login.php And I wanted to leave her like this: www.site.com.br/login How can I do this through . htaccess?…
htaccessasked 7 years, 4 months ago WillianSmite 21 -
2
votes1
answer4680
viewsError 404 Page PHP STANDARD HTACCES
Have the following structure in . htaccess: RewriteEngine On RewriteRule ^www\/login\/?$ login/ [L,NC,R] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.php -f RewriteRule…
-
2
votes1
answer616
viewsHow to use subfolder as main folder without changing URL (joomla site)
I have a website that I’m redoing. The old one was made in wordpress (at the root of the site) and the new one in joomla (in the folder "new") I want the domain.com.br to be redirected to the…
-
2
votes2
answers1228
viewshtaccess rule for adding https
I am trying to create a rule within my htaccess to add the url to HTTPS. It turns out that this should only happen for a specific domain, how to treat this in a rewritecond http_host? example:…
-
2
votes1
answer2127
viewsWhy can’t the web server find my route?
I did the upload of a system in Laravel called android_api on the hostgator server, and configured in the public file. Until the main page it works, where Laravel 5 appears, but when I put the route…
-
2
votes1
answer56
viewsHow to modify the URL of www.meusite.com/index.php? secao=quemsomos para www.meusite.com/quemsomos?
My file . htaccess is this way: RewriteEngine ON RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?secao=$1 I want to translate the url…
-
2
votes2
answers260
viewsHow to disable directory listing in Wordpress
Good afternoon everyone, I would like my directory listing not to be exposed, I used the following code within the .htaccess Options -Indexes, but when I test the code by renaming the index php. he…
-
2
votes1
answer41
viewsUrl forwarding by company
I’m creating multi tenacy system, I have access page for companies https://www.teste.com.br/pastasistema/home views, what I would like and the user to type https://www.teste.com.br/empresa1/home…
-
2
votes1
answer4457
viewsHide the . html extension of the files in the url using . htaccess
I created some pages .html and put online. In the browser the file extensions are visible. However I want to hide them to make the urls more "friendly". For example: instead of…
-
2
votes1
answer453
viewsSend parameters via GET to a friendly URL
I have a page that the URL friendly is more or less like this: http://www.dominio.com.br/pt/produtos/ And the real URL is like this: http://www.dominio.com.br/site/produtos/index.php?idioma=pt I’m…
-
2
votes2
answers220
viewsDoubt about htaccess
I have a friendly link that would be localhost/artists/nome-do-artista/, but I want to create pages inside it for example Biography. localhost/artists/nome-do-artista/biography, only that my…
-
2
votes0
answers43
viewsFriendly URL works and to
Well, I have a problem with the .htaccess e a URL amigável, it works, but sometimes it stops and comes back to work. (Rewrite module is active, use PHP 7). And I have one more question, I have a…
-
2
votes1
answer614
viewsBlock file download via PHP script
Hi, I’m having trouble downloading some files. I suspect that someone on the team is 'inputando' a php script that downloads files from the server (such as bd settings in production). I wonder if it…
-
2
votes1
answer140
viewsRedirect Problems with . HTACCESS
I am developing my site and it is in great condition, however I have a small problem in the matter of redirects of the site. The link to my website is this: Website - Lougans I created in my…
-
2
votes1
answer91
views301 htaccess redirect with and without www to HTTPS
Good morning. I’d like your help. I need to make an htaccess that works like this: Redirect 301: "site.com" or "www.site.com" for https://www.site.com If the person comes from a google url, and does…
-
2
votes1
answer223
views.htaccess and rewrite rules in PHP server
I am developing a php microframwork, and I am using the built-in php server (php -S 127.0.0.1:8000 -t public) with root directory in the public folder/. I don’t know if . htaccess works or is…
-
2
votes2
answers571
viewsHow to remove public from url
I’m creating a small application and have a url like root/public/index.php, wanted to know how to remove this public and leave the url alone root/index.php using .htaccess. I’ve searched Google and…
-
2
votes0
answers54
viewshtaccess does not work in "online" subdirectory
I made a small script that runs locally inside a folder (localhost/sistema) so far all right, the problem started to happen after I tried to upload that same script to an online server (Hostgator),…
-
2
votes1
answer378
viewsBlock direct access to a php page
I’m making a login page where the user, when logging in index.php it goes to the.php dashboard. I was able to block access to the.php panel with SESSION, but if I access connected.php (where you…
-
2
votes0
answers48
viewsHow to prevent a specific page from being redirected to https without using php?
Hello. I need to avoid redirecting a page from my site to https, but I didn’t want to use php, java, or other programming language. I’d like to use the .htaccess On my website, I used the rule below…
-
1
votes1
answer373
viewsLoad "php.ini" specific for a sub-domain
To carry a php.ini customized for a sub-domain, I applied to .htaccess at the root of the sub-domain concerned the following code: AddHandler php5-fastcgi .php Action php5-fastcgi /cgi-bin/php.fcgi…
-
1
votes1
answer847
viewsFriendly URL on Windows 2003/2008 hosting with PHP site
I need to convert this file .htaccess for a Windows hosting compatible format at Locaweb. RewriteEngine On RewriteCond %{SCRIPT_FILENAME} !-f RewriteCond %{SCRIPT_FILENAME} !-d RewriteRule ^(.*)$…
-
1
votes4
answers3185
views301 https protocol redirect to http
I would like to make a 301 redirect (through .htaccess) only on 1 link I have https to http without changing any other server link or protocol. Link https:…
-
1
votes1
answer449
viewsUsing Codeigniter within Wordpress
I am working on a blog where within a specific page it has an iframe that points inside the server itself, calling a folder that contains the running Codeigniter. Until a few days everything worked,…
-
1
votes2
answers958
viewsMask wp-admin/wp-login with . htaccess
I’m trying to mask the Wordpress login URL. For example, I was able to do the basics of making the url friendly: ^login /wp-login.php [L] Turns out I don’t want to allow access using the direct URL…
-
1
votes1
answer655
viewsUser-friendly URL with HTACCESS
I’m making my system that will use htaccess-friendly URL, only I’m having a question/problem. My HTACCESS is as follows: RewriteEngine ON RewriteCond %{REQUEST_FILENAME} !-f RewriteCond…
-
1
votes2
answers7595
viewsRedirect URL to another physical folder with . htaccess
On the Ubuntu server, I have a physical folder: /var/www/html/gestao/site/temp/ I wish my .htaccess redirect to the URL domain.com.br/gestao for this physical folder transparently.…
-
1
votes2
answers507
viewsDifficulty with rewriting friendly Urls
I don’t have much experience with . htaccess and am having some difficulty rewriting a website’s Urls. On the site in question, I first forced the rewriting of the URL to HTTPS (the site did not…
-
1
votes3
answers2723
viewsDomain without www does not work
At the root of the server I have a folder "wp" where I have Wordpress installed. I put inside the folder because the site was not made with Wordpress and yes the blog. When typing the url…
-
1
votes1
answer40
viewsProblems with . htaccess on Lampstack
I have the following problem. I have a website that uses htaccess. I work locally on the website and it works normally, all redirects work perfectly. When I went up my application to the…
-
1
votes1
answer72
viewsDisregard HTTP authentication for a given URL
I have an application developed in Cakephp 2, but I believe that the issue does not have as much involvement with the framework itself, just citing to contextualize. Being this private application,…