0

i'm trying this:

.htaccess

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

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

</IfModule>
# END 

html file

<!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>

but nothing happens. h1 don't change it's color.

PD: inside folder wp-content exists customjd.css h1 color red.

2
  • Location of htaccess? Commented Nov 15, 2015 at 4:49
  • @hjpotter92 localhost/proyect/rewrite Commented Nov 15, 2015 at 4:53

1 Answer 1

2

Edit the htaccess code to:

RewriteEngine On

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

Change the HTML code to:

<!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>

where the CSS code inside customjd.css is:

h1 {
  color: red;
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.