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
answer95
viewsHow to map all requests to a single file?
I need to map all requests that arrive to the server as follows: exemplo.com/joao => exemplo.com/index.pl?u=joao exemplo.com/joao/ => exemplo.com/index.pl?u=joao My file /var/www/.htaccess is…
-
0
votes1
answer569
viewsHow to free access to Public folder
Hello, I am trying to use htaccess to redirect a project, but I have encountered a problem regarding access to my Public folder, where my Assets are located. Below follows my .htaccess <IfModule…
-
0
votes1
answer1537
viewsRemove public from URL - Laravel
I’m accessing my website like this: http://localhost/site/public I’d like to just type http://localhost/site because I want it to work when I put it in the domain too. Is there any way to resolve…
-
0
votes0
answers163
viewsURL friendly in two subdirectories
I’m trying to make the url friendly with . htaccess therein: RewriteEngine On RewriteRule ^([a-z_-]+)$ index.php?p=$1 RewriteRule ^([0-9]+)$ index.php?g=$1 RewriteRule ^([a-z_-]+)\/([0-9]+)$…
-
0
votes1
answer357
viewsUseful commands for . Htacess
I would like to know some commands to use in . htacess that allow to do the following actions. 1- Block access to all directories so that if the user tries to see the contents of this directory is…
-
0
votes1
answer32
views.htaccess remove vars name from url but leave vars
Right now I have the Urls: www.meudominio.com/?route=service&serv_name=cascais_proxima&id=1 and www.meudominio.com/?route=ticket&serv_id=1&ticket=A but I’d like you to stay:…
-
0
votes1
answer53
viewsCreating . httacess for wordpress
I set up a wordpress on a linux hosting, need to set up so that the post url instead of: http://www.example.com/index.php/post be it: http://www.example.com/post From what I read I must mecher in…
-
0
votes1
answer373
viewsHow to change link from my htaccess page
My normal url is: http://localhost/paginas/noticias.php?id=1 I wish so: http://localhost/paginas/noticias/1 id 1 is generated by php, I don’t know how to get it this way in htaccess.…
-
0
votes2
answers63
viewsHTACCESS - External File
I have a file . htaccess, but if I have a file outside the folder, it does not allow me access... And I would like you to allow: RewriteEngine on RewriteCond $1…
htaccessasked 9 years, 4 months ago Sr. André Baill 6,946 -
0
votes2
answers4183
viewsEnable . htaccess on Ubuntu 14.10, Apache/2.4.10
I’m trying to enable the . htacces on Ubuntu 14.10,. I’m putting the files in the /var/www/ I’ve tried but I can’t seem to make it work. apache2ctl -S: VirtualHost configuration: *:80 127.0.1.1…
-
0
votes1
answer50
views.htaccess redirect when index
How to redirect user when it tries to access a folder whose in it does not contain the index? Ex: www.eu.com/ <-- index OK www.eu.com/arquivos/ <-- index Of redireciona para página inicial…
-
0
votes1
answer255
viewsChange all type of re-request keeping the parameters and URL via htaccess
I’ve been racking my brain for hours trying to figure out this htaccess thing My need is the following, I have a root directory of my system, and each user accesses the system by URL…
htaccessasked 9 years, 3 months ago Vinicius Nyx 13 -
0
votes1
answer846
viewsRedirect any URL html extension to a specific page
Please I have a question on . htaccess (or apache). I need to redirect any url that contains extension .html or .htm to a specific url. Example: domain.com/test.html -> domain.com/page…
-
0
votes1
answer272
viewsRedirect - User-Friendly URL . HTACCESS
I created a domain redirect to a subfolder, look how it turned out: # Redirect from www to non-www location RewriteEngine on RewriteBase / RewriteCond %{HTTP_HOST} ^www.meusite.com.br [NC]…
-
0
votes1
answer271
viewsForce via HTACESS a single URL to run without https
I have an Ecommerce site, it’s all running with HTTPS, so I put this code in HTACESS: RewriteCond %{HTTPS} off RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] It works well, the problem…
htaccessasked 9 years, 1 month ago caiocafardo 1,897 -
0
votes1
answer1467
viewsHow to redirect domain . com . htaccess
I have 2 domains, example.com and example.com.br pointing to the same wordpress site. I would like to redirect every time someone enters example.com, be redirected to example.com.br/en I found this…
-
0
votes0
answers51
viewsPHP-friendly URL with htaccess
Good morning, I am creating a simple system in PHP to learn more about MVC. Would you like to retrieve from the URL the information contained in '?pag='. How to do this? I need to change my file…
-
0
votes1
answer287
viewsHtaccess - Document root
I’d like to do the following: #diretorio não existe www.teste.com.br/diretorio every time you access this address, apache would open: #outro_diretorio/pagina esse existira…
htaccessasked 9 years, 1 month ago Programa Imobiliária 1 -
0
votes0
answers108
viewsPick the string of a non-existent request
How to pick the string of a non-existent request? I am using . htaccess to redirect missing url requests (error 404). But I would like when the 404.php page was displayed, I would like to pick up…
-
0
votes0
answers87
viewsRewriterule Problem (HTACCESS)
I have the following HTACCESS code: <IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^customer/$ index.php [L,NC] </IfModule> (I cleaned the rest of the code to simplify.) In the…
-
0
votes1
answer71
viewsRedirect 301 adding many "/"s at the end
I am facing the following problem with the combination of more than one .htaccess in my project. I have the following structure siteprincipal.com.br (não é WordPress) and inside a domain with…
-
0
votes0
answers58
viewsHow to access a page through dynamically friendly urls?
Well, I must be wanting something very complicated for a beginner but come on ... I’m starting a system where I need to create dynamic and friendly urls to register all the information regarding a…
-
0
votes2
answers204
viewsHow do I type this url into . htaccess to get a friendly url?
I need to write an instruction on .htaccess to get this url in a user-friendly format. This is it: http://dent.axitech.com.br/admin/views/home.php ... I need it to turn into:…
htaccessasked 9 years ago Marcos Vinicius 7,188 -
0
votes0
answers57
viewsHow can I make this url more user friendly?
I’m developing this site and studying a little about friendly url’s since I was a Wordpress user and now I’m moving to frameworks and systems. What I want to know is whether the url shown below…
-
0
votes2
answers1115
viewsURL rewriting with parameter for another site . htaccess
I’d like to write a rule on .htaccess with the RewriteRule so that when someone enters the old site, be redirected to the new site keeping the requested parameter on the old site. Old site:…
-
0
votes0
answers76
viewsRedirect "cropped" url to canonized url (Avoid duplicate url)
What are the settings in . htaccess so that url cut type: http://meusite.com/cidade/495/politica-de-priv is automatically redirected to the canonized (whole) url of the page:…
-
0
votes1
answer43
viewsDifficulty making Rewriteengine work
I need to use this command below. On my server works well, but when I went to install on another this same line of error throughout the site. I need this because the command will come differently…
-
0
votes2
answers1524
viewsHTACCESS URL rewriting by ignoring existing files and folders
When I go to pass a site in the server I put a file .htaccess with this code below: <IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^(.*)$ public/$1 [L] </IfModule> This code…
-
0
votes1
answer1698
viewsCSS and Javascript files do not load when I use Amigavel URL
Hello, I’m trying to create URL Amigavel and even worked in some pages only in some is not working CSS, JS etc.. I’m using this in . htaccess: <IfModule mod_rewrite.c> RewriteEngine On…
-
0
votes1
answer2177
viewsHide folder from URL
Guys I’m having difficulty adapting this code, my site is in a folder calls site I want to hide this folder and leave everything if it had the root, until then it works, the problem is when I access…
htaccessasked 8 years, 10 months ago lgustavo206 13 -
0
votes1
answer24
viewsHow to reuse my . htaccess
I have the following file RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.php -f RewriteRule ^(.*)$ $1.php I can access the page without the extension. I would…
-
0
votes1
answer216
viewshtaccess does not work for wp super cache plugin
I installed the wp plugin super cache for wordpress on the server and it’s working fine. But I can’t understand why my rules on . htaccess does not work for the homepage. I rewrite the requests pro…
-
0
votes1
answer129
viewsHow to change contents of . htaccess via php?
I was wondering if there is any way to change . htaccess via php. An example of what I want is that by htaccess I can restrict the access of a certain ip with the command: deny from 67.114.135.60 If…
-
0
votes1
answer93
viewsIs it possible for htaccess to interpret a file as a directory (subdomain)?
I have several files with various contents, like: ajuda.php? go=Faq, ajuda.php? go=form, etc. Wanted something like: help.site.com/Faq, help.site.com/form, etc. It would be possible via htaccess for…
-
0
votes1
answer63
viewsI would like to make my URL friendly on . htaccess
Hello, I am trying in several ways trying to make my URL more friendly but I am not able to leave, she is like this:…
-
0
votes1
answer392
viewsany . htaccess file gives error 500 how to resolve?
any file . htaccess gives error 500 how to solve? Whenever I put a file . htpaccess always gives error this is the code <IfModule mod_rewrite.c> RewriteEngine on # Redirect to domain with www.…
htaccessasked 8 years, 8 months ago Amadeu Antunes 3,331 -
0
votes1
answer776
views.htaccess - Special character friendly urls
I have the following line: RewriteRule ^usuario\/([a-z,0-9,A-Z,._-]+)?$ index.php?pg=usuarios&usuario=$1 I needed him to accept the characters @ : = ! ? How can I do?…
-
0
votes0
answers91
viewshtacess with variables
Hello, I’m trying to use htacess with variais, but I’m not succeeding. my htacess ta thus RewriteEngine On RewriteRule ^$ /site/ RewriteRule ^index$ /site/index.php RewriteRule…
htaccessasked 8 years, 7 months ago Débora Gonçalves 121 -
0
votes2
answers294
viewsRule for redirecting with parameters
I’m trying to build a friendly URL system but I’m having the following problem: I have a page that has a list of several items. The page has this URL: http://localhost/personal/portifolio When the…
-
0
votes1
answer935
viewsInternal Server Error with Htaccess File
It all started when I switched from Easyphp to Vertrigoserv, the file. htaccess worked perfectly on Easyphp , but here I am finding these problems... I have no idea how to solve this... HTACCESS…
-
0
votes0
answers37
viewsRedirect or remove Function.include with . htaccess in Wordpress
I wonder if there is how I redirect error 404 of various articles that has been going on, the example is the following: http://meu-site.com/artigo-1/function.include…
-
0
votes2
answers53
viewsSite malfunction after change in . htaccess
For a site to get more url friendly I removed the .php using the following commands within the .htaccess: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^([^\.]+)$ $1.php [NC,L] It…
-
0
votes1
answer50
viewsHtaccess does not correctly validate the redirect rule
Has in htaccess in which the regex works perfectly without numbers in the rule, but with numbers does not work properly. RewriteRule ^([a-zA-Z]{1,20})-to-([a-zA-Z]{1,20})-([a-zA-Z0-9-]{1,30})\/?$…
-
0
votes2
answers1723
viewsHow to remove index through . htaccess file from site?
Hello, I am making a site and I would like to remove the index by changing to another address ex: site.com.br/Uritiba - WITHOUT USING REDIRECTION IN CPANEL. I am looking for a solution in . HTACCESS…
-
0
votes1
answer742
viewshow to pass Url parameter via get
I am having a question regarding passing parameters from one page to another. I have tried it in several ways via get. I can even get the parameter, but not all the parameters I can get. In the…
-
0
votes0
answers77
viewsHow to ignore a subdirectory that is not being represented at the current address?
Obs: The links are fictitious, but they represent my problem. I have a project done in pre-store that in the production environment, is within a subsdirectory: www.site.com/rio/index But in my…
-
0
votes1
answer1070
viewshow to remove.php with . htaccess
Good guys I’m used to calling the following link with my apache: index.php?variavel1=1&variavel2=2 Can I make my . htaccess identify the following link: index?variavel1=1&variavel2=2 And…
-
0
votes1
answer132
viewsRedirect via htaccess
Good afternoon Guys, I need to do the following on my . htaccess. If the REMOTE_ADDR (IP) for nesse range 192.168.0.1 até 192.168.10.254 acessa por 192.168.0.5/system If the REMOTE_ADDR (IP) for an…
htaccessasked 8 years, 5 months ago Eduardo Santos 754 -
0
votes0
answers610
viewsHow to enjoy browser caching?
I read and reread several times on this subject but never understand how something I do on my computer will make the site get faster on third party computer... Not to mention that when making such…
-
0
votes1
answer7852
viewsAutomatic PHP friendly URL
I’m looking to develop a site like migre.me, he doesn’t use method GET visible, and its URL looks like this: http://migre.me/upR3N I want to make a system to save the URL in Mysql, and create a URL…