URL rewriting in .htacces

3

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/?$ /application/views/ambiente_teste/assets-teste [NC,L]

But I'm not very experienced at it, so I wonder if anyone has a solution.

Thanks ^^

    
asked by anonymous 16.12.2014 / 20:20

2 answers

3

This will be an express response ^ _ ^

Your url does not start with test-assets , so take that circumflex that the expression marries only backwards and then it will work:

RewriteEngine On
RewriteRule assets-teste/?$ /application/views/ambiente_teste/assets-teste/ [NC,L]
    
16.12.2014 / 22:23
0
# Ativamos a reescrita
RewriteEngine On
RewriteBase /

# Alterar URL
RewriteRule ^assets-teste /application/views/ambiente_teste/assets-teste/ [NC,QSA,L]
    
16.12.2014 / 21:25