使用httacces隐藏文件夹或路径css js文件

时间:2015-11-15 03:06:08

标签: html css mod-rewrite base-tag

我正在尝试这个:

的.htaccess

# BEGIN 
<IfModule mod_rewrite.c>
RewriteEngine On
#RewriteBase /proyect/rewrite/

RewriteRule ^css/(.*) /proyect/rewrite/wp-content/$1 

</IfModule>
# END 

html文件

<!DOCTYPE html>
<html>
<head>

<!-- H1 COLOR BLUE -->
<link href="http://localhost/proyect/rewrite/wp-content/css/customjd.css" rel="stylesheet" type="text/css" > 

<!-- H1 COLOR RED-->
<base  href="/customjd.css" >

</head>

<body>

<h1>hello world!</h1>

</body>

</html>

但没有任何反应。 h1不要改变它的颜色。

PD:内部文件夹wp-content存在customjd.css h1颜色为红色。

1 个答案:

答案 0 :(得分:2)

$validator = Validator::make($PasswordData, User::$rulespwd, $messages); if ($validator->passes()) { $user = User::find(Auth::user()->id); $user->password = Input::get('NewPassword'); $user->save(); return Redirect::to(Session::get('urlpath') . '/changepassword')->withInput()->with('Messages', 'The Password Information was Updated'); } else { return Redirect::to(Session::get('urlpath') . '/changepassword')->withInput()->withErrors($validator); } 代码编辑为:

htaccess

将HTML代码更改为:

RewriteEngine On

RewriteRule ^(css/.*\.css)$ /proyect/rewrite/wp-content/$1

<!DOCTYPE html> <html> <head> <base href="/proyect/rewrite/"> <link href="css/customjd.css" rel="stylesheet" type="text/css"> </head> <body> <h1>hello world!</h1> </body> </html> 内的CSS代码是:

customjd.css
相关问题