简体   繁体   English

htaccess xampp无法正常工作

[英]htaccess xampp not working

I need help with my .htaccess what i want is change this url 我需要帮助我的.htaccess我想要的是改变这个网址

http://localhost/blog/admin/editar_articulo.php?accion=27 HTTP://localhost/blog/admin/editar_articulo.php安信永= 27

to

http://localhost/blog/admin/editar_articulo/27 HTTP://本地主机/博客/管理/ editar_articulo / 27

But my code does not work. 但我的代码不起作用。 Is showing a server error 500, I have this code Iam using xampp 显示服务器错误500,我有这个代码我使用xampp

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog/admin # in folder admin is where i have the .htaccess file
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^editar_articulo/([0-9]+)/?$ editar_articulo.php?accion=$1 [NC,QSA]
</IfModule>

I tried this and worked 我试过这个并且工作了

RewriteEngine On
RewriteRule ^editar_articulo/(\w+)$ editar_articulo.php?accion=$1

But its not showing my css in the page what am I doing wrong? 但它没有在页面中显示我的CSS我做错了什么?

in <head> tag create <base> tag to set all external links url <head>标签中创建<base>标签以设置所有外部链接url

<head>
  <base href="http://www.mywebsite.com/">
  <link rel="stylesheet" href="css/mycssfile.css">
</head>

browser read href="css/mycssfile.css" as href="http://www.mywebsite.com/css/mycssfile.css" 浏览器读取href="css/mycssfile.css"href="http://www.mywebsite.com/css/mycssfile.css"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM