Help with mod Rewrite

need some redirection help for a testing platform/subdirectory on a production box
In the root document directory:
I have html pages that have a link to a css file
<link href="/template/screen.css" ...

I want to move a copy of these html files to the directory wpupgrade
so Ill be testing at http://www.mysite.org/wpupgrade/file.html

Is it possible to use an .htaccess set up to that html files in the wpupgrade directory actually pull the css info from wpupgrade/template/screen.css???
I have lots of html files and would rather not have to 'touch' each one of them to repoint them
something like
condition  /template/screen.css
contition  (http_referer)  /wpupgrade  (something which only affects html files in the wpupgrade directory and has no affect on files in the root directory)
rewrite  /wpupgrade/template/screen.css
allan1956Asked:
Who is Participating?
 
allan1956Connect With a Mentor Author Commented:
None of the above seem to do what I wanted.  I also tried placing them and versions of them in the template/ directory

As a not I dont seem to be able to use the RewriteEngine On when I place them in / and i/templates,  generates a server error.  I think rewrite on was done once and it doesnt liek being called more then once?

0
 
yo_s_cantaCommented:
Hello,

Try with this code
RewriteEngine on
 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ wpupgrade/$1 [L,QSA]

Open in new window

0
 
ravenplCommented:
RewriteCond %{HTTP_REFERER} ^/wpupgrade
RewriteRule ^template/screen.css$ wpupgrade/template/screen.css [L]
0
 
yo_s_cantaCommented:
This will work
RewriteEngine on
RewriteRule ^(.*)$ wpupgrade/$1 [L]
0
All Courses

From novice to tech pro — start learning today.