So I have this rule in place
# Rewrite for account view
RewriteRule ^([^/]+)/([^/]+)/?$ account.php?type=$1&user=$2 [NC,L]
which translate to http://www.site.com/user/s2xi
but now I want to get even more creative with the url and append a theme location to it so:
http://www.site.com/user/s2xi/theme/slate/
so that I can for instance access the CSS file for the theme I would simply need to type in
http://www.site.com/user/s2xi/theme/slate/css/slate.css
how can I modify or add another RewriteRule to be able to get the results I want?
also, how would I be able to apply and access my theme files with the new url in my PHP code?
my current path to my themes is library/themes/users/slate with sub folders /css and /js
My attempt:
# Rewrite for user theme location
RewriteRule ^([^/]+)/([^/]+)/theme/([^/]+)/?$ account.php?type=$1&user=$2$theme=$3 [NC,L]
I suggest redirecting all requests to one file, e.g.
index.phpand then get the url by using$_SERVER['REQUEST_URI']. You can then use this data and for example explode it. Then you will be able to dynamically determine which page will be loaded.You can use the following code to redirect all requests to
index.php:You could also exclude particular filetypes from being redirected to this PHP file. For example static content like CSS, JavaScript etc. The following code will, for example, exclude all files with a CSS, JS, PNG or JPG extension:
To exclude all files that do exist, you could use the following code: