Forum Moderators: phranque
New here and would love some help.
I am trying to rewrite a url, and I got it to work, but it looks like all the CSS formatting disappers when I do so.
This is what I have in my .htaccess file:
RewriteEngine on
RewriteRule ^([^/\.]+)/([^/\.]+)/?$ file.php?val1=$1&val2=$2 [L]
which outputs this url
www.mysite.com/value1/value2
When I navigate to that page, all the formatting is gone. Do I need to add or remove something from the .htaccess?
Thanks a lot.
-Chris
In file.php, add a / (slash) to the css include:
<link type="text/css" href="/styles/index.css" rel="stylesheet" />
Assuming www.site.com/styles/index.css
value1 and value two are not directories, they are variables that are dynamically generated on the output page.
i.e. www.mysite.com/file.php?val1=free-phone&val2=chicago
becomes
www.mysite.com/free-phone/chicago
and "free phone" and "chicago" appear on the output page.