Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have directory named /template/css

The full url is http://sitename.com/template/css

I need this folder to be redirected using apache mod rewrite

from

http://sitename.com/template/css

to:

http://sitename.com/css

How can I do this?

share|improve this question

migrated from stackoverflow.com Aug 14 '11 at 22:11

This question came from our site for professional and enthusiast programmers.

Why do you need to use mod_rewrite? Why don't you just Alias /css to the location in the filesystem where the CSS files are actually stored?

Assuming that you do have a valid reason for doing this, the following should do the trick:

RewriteEngine On
RewriteRule ^/template/css(.*)$ /css$1
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.