Questions tagged as 'mod-rewrite'

1
answer

Rewrite URL for root access but not block access to sub-domains

I have the following code that rewrites the URL you entered to correctly identify the areas, sub-areas, and content ID that the visitor is trying to access: # Rewrite the url <IfModule mod_rewrite.c> RewriteEngine On # Redirect whe...
asked by 25.01.2014 / 19:14
2
answers

What is [QSA] for and similar in RewriteRule?

I have as an example the following RewriteRule ^(Home)?/?$ page/php/Home.php [NC,L] I know that NC is Non-Case(Não diferencia maiúsculas e minusculas) . L means that if a RewriteRule is true it stops checking....
asked by 08.10.2014 / 14:31
1
answer

How does RewriteBase work in .htaccess?

I've always used .htaccess to url's amigáveis no php , but recently when I moved to the server of a company X, the .htaccess that always worked did not work on that server .... After searching, I discovered that just putting R...
asked by 23.09.2014 / 22:07
2
answers

Targeting all traffic from root to sub folder results in error "403 forbidden" if it does not have "index.php"

The code below works perfectly to direct all site traffic transparently into the www folder: Options -Indexes +SymLinksIfOwnerMatch RewriteEngine on RewriteBase / # Verificar o destino RewriteCond %{HTTP_HOST} ^(www.)?example.com$ # I...
asked by 18.03.2015 / 12:41
2
answers

Interpret and direct with URL that after domain contains a hash

I am creating a rule to interpret addresses that after domain begin with # followed by numbers or followed by letters whose rule should only be read if there is no file or directory that matches the path indicated: # Rewrite the url <...
asked by 13.03.2014 / 12:37
4
answers

How 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 you have "/?" in the end. The code I made was: .*\/([a-zA-Z0-9]*)[\/\?].*...
asked by 18.09.2017 / 16:25
2
answers

URL rewriting in .htacces

I have the following URL: http://<site>/application/views/ambiente_teste/assets-teste/... And I wanted to re-add it to: http://<site>/assets-teste/... I tried the following in my .htaccess: RewriteRule ^assets-teste/?$ /a...
asked by 16.12.2014 / 20:20
1
answer

How to use friendly urls?

I currently use MVC in my project and when I access my system it shows a url like this: http://localhost/view/html/cliente.html What I would like to get is: localhost/cliente because it is the only file called clien...
asked by 05.03.2015 / 14:52
2
answers

Put bar at the end of the url with .htaccess

I need to add a forward slash (/) to the end of the url using .htaccess. My current .htaccess looks like this: <IfModule mod_rewrite.c> Options +FollowSymLinks RewriteEngine on RewriteCond %{HTTP_HOST} ^dominio.com.br [NC] RewriteRule...
asked by 19.02.2016 / 15:16
1
answer

How to make every request be directed to a subfolder? (HTACCESS)

I have tried several tutorials and none worked beyond index.php . I use LOCALHOST and I want every request, of any kind, example: localhost:8080/teste.php localhost:8080/imagens/algo.jpg localhost:8080/teste2.php?querystring=ok...
asked by 26.06.2015 / 21:09