1

I am trying to beutify the url so I have created the following .htaccess file:

Options +FollowSymLinks

RewriteEngine On

RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f

#RewriteRule ^target/([a-zA-Z0-9]+)/$ index.php?target=$1
RewriteRule ^quienes-somos$ index.php?target=about
RewriteRule ^el-equipo$ index.php?target=equipo
RewriteRule ^a-quien-va-dirigido$ index.php?target=dirigido
RewriteRule ^programa-integrativo-para-directivos$ index.php?target=pid
RewriteRule ^modulos-especificos$ index.php?target=modulos
RewriteRule ^espacio-empresa$ index.php?target=empresa
RewriteRule ^espacio-individual$ index.php?target=individual
RewriteRule ^trabajo-bioenergetico$ index.php?target=bionergetico

RewriteRule ^([a-zA-Z0-9]+)$ index.php?target=$1

Everything looks fine when request:

http://inside.amimusa.org/modulos-especificos

but when request is:

http://inside.amimusa.org/modulos-especificos/

the page is not found.

I added a new line to .htaccess to allow the ended slash as follows

 RewriteRule ^(.+)/$ /$1 [L]

and

http://inside.amimusa.org/modulos-especificos/

works but the static resoruces are not found:

"NetworkError: 404 Not Found - http://inside.amimusa.org/modulos-especificos/js/sweetalert.min.js"
sweetalert.min.js
"NetworkError: 404 Not Found - http://inside.amimusa.org/modulos-especificos/css/sweetalert.css"
sweetalert.css
"NetworkError: 404 Not Found - http://inside.amimusa.org/modulos-especificos/js/sweetalert.min.js"
sweetalert.min.js
"NetworkError: 404 Not Found - http://inside.amimusa.org/modulos-especificos/css/sweetalert.css"

I tried to add a new rewrite rule as:

RewriteRule ^(.+)/js/(.+)$ /$2 [L]
RewriteRule ^(.+)/css/(.+)$ /$2 [L]

but it seems to not be the trick.

Anybody could help?

1 Answer 1

1

This do the trick:

RewriteRule ^(.+)/js/(.+)$ /js/$2 [L]
RewriteRule ^(.+)/css/(.+)$ /css/$2 [L]

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .