我的htaccess上有这种奇怪的行为:
所有的“前”链接都工作正常,但是在editar_post和editar_usuario上,那些包含GET参数的链接,我丢失了所有CSS和JS文件:

RewriteEngine On

######     Admin     #####

# Posts

RewriteRule ^listar_posts/?$ listar_posts.php [NC]
RewriteRule ^editar_post/?$ editar_post.php [NC]
RewriteRule ^editar_post/([0-9]+)/?$ editar_post.php?post_id=$1 [NC]
RewriteRule ^nuevoPost/?$ nuevoPost.php [NC]

# Usuarios
RewriteRule ^listar_usuarios/?$ listar_usuarios.php [NC]
RewriteRule ^nuevo_usuario/?$ nuevo_usuario.php [NC]
RewriteRule ^editar_usuario/([0-9]+)/?$ editar_usuario.php?id_usuario=$1 [NC]
RewriteRule ^editar_usuario/?$ editar_usuario.php [NC]

# Login
RewriteRule ^login/?$ login.php [NC]

#Front
RewriteRule ^front/?$ front/index.php [NC]
RewriteRule ^front/([0-9]+)/?$ front/post.php?post_id=$1 [NC]
RewriteRule ^front/tecnologia?$ front/search.php?seccion=Tecnologia [NC]
RewriteRule ^front/marketing?$ front/search.php?seccion=Marketing [NC]
RewriteRule ^front/emprende?$ front/search.php?seccion=Emprende [NC]
RewriteRule ^front/tips?$ front/search.php?seccion=Tips [NC]


你能帮我么?

(同样,如果我将CSS和JS放在绝对路径上,那么我将一无所有)

最佳答案

htaccess工作正常,但基本href添加元

<head>
 <base href="http://www.domain.com/" />
</head>

关于javascript - 编辑htaccess时CSS和JS丢失,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/36611376/

10-12 17:20