I’m writing a website and I have a php file in the home directory that will grab the GET variables in the query string and open a video based on the query string id. The query string is: http://www.viewingtree.com/playlists.php?id=5914242 . I want to make that string look like http://www.viewingtree.com/playlists/5914242 . I’m using a .htaccess file on an Apache server with mod_rewrite installed, so I have this as my .htaccess file:
Options +FollowSymLinks
Options -MultiViews
RewriteEngine On
RewriteRule ^playlists/([0-9]+) /playlists.php?id=$1 [L]
RewriteCond %{REQUEST_URI} !(\.[^./]+)$
RewriteCond %{REQUEST_fileNAME} !-d
RewriteCond %{REQUEST_fileNAME} !-f
RewriteRule (.*) $1.php [L]
When I enter the URL with the query string, the web page loads as it should. However, when I use the SEO-friendly URL, the page still loads but without any of the CSS formatting that I used. Is my .htaccess incorrect, or what?
I recommend using absolute URLs for CSS and JavaScript. The relative URL is causing this issue.
Try something like: