Link to home
Start Free TrialLog in
Avatar of allan1956
allan1956

asked on

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
Avatar of yo_s_canta
yo_s_canta

Hello,

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

Open in new window

RewriteCond %{HTTP_REFERER} ^/wpupgrade
RewriteRule ^template/screen.css$ wpupgrade/template/screen.css [L]
This will work
RewriteEngine on
RewriteRule ^(.*)$ wpupgrade/$1 [L]
ASKER CERTIFIED SOLUTION
Avatar of allan1956
allan1956

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial