htaccess redirection

Asked

Viewed 69 times

1

I have the following redirect:

RewriteRule ([^/]*)\/([^/]*) http://ip/~user/codigo.php?nome=$1&numero=$2

To generate the url:

http://www.site.com.br/stackoverflow/123456

But there are other folders, like Assets/css/main.css and others like /css/name/other.css and these are being redirected to:

Ex: http://www.site.com.br/codigo.php?nome=assets/css&numero=main.css

How to solve the problem?

I tried something like:

RewriteRule ^assets/(.*)$ http://www.site.com.br/assets/$ 

Observing: there are other folders besides the Assets example and some of them have subfolders and some do not, IE, there is no pattern.

1 answer

0


I got a solution to my problem.

I added the following:

RewriteRule ^(assets|css|images|js|fonts) - [L]

Before the redirect:

RewriteRule ([^/]*)\/([^/]*) http://ip/~user/codigo.php?nome=$1&numero=$2

And it worked perfectly.

For those with the same problem, this is the solution.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.