URL Rewrite rules |
[eluser]macleodjb[/eluser]
I'm having some trouble with the rewrite rules. I copied this right out of the user manual and it doesn't work properly Code: RewriteEngine on It works on the main index page, but my css gets lost somewhere. If i try to add a controller like www.example.com/register it doesn't work at all and shows the main index.php page. If i try to call the controller direct like www.example.com/index.php/register it calls the controller but again my css doesn't load. Any suggestions? This implementation is becoming very tiresome.
[eluser]Dyllon[/eluser]
Where is your css located in the file structure? My guess is you are either referencing it incorrectly or you need to add an exception to your RewriteCond.
[eluser]macleodjb[/eluser]
my css is located outside my system folder in the root directory contained in a folder that named css. That's only half my problem the other half is that whenever i place rewrite statements my sub controllers don't work
[eluser]Phil Sturgeon[/eluser]
Please search the forums for questions like this as the same problem has been answered so many times. You need to add any static content into your rewrite condition like this: Code: RewriteEngine on or use a more dynamic solution like the following code, which will say "if it is not an existing file or directory, plese route via index.php". Code: Options +FollowSymLinks In this one (a mini version of the code I use) you will notice the leading slash has been removed from index.php. This means it will always stay relative to the location of the .htaccess file which could solve the problem with your "sub-controllers" not loading correctly.
[eluser]macleodjb[/eluser]
I don't know what my malfunction is. I've tried everything suggested to me and it still does not work. I have a controller called register.php i should be able to access it like www.example.com/register Correct or no? even with the rewrite you suggest i can only access it like this www.example.com/index.php/register
[eluser]macleodjb[/eluser]
take a look at the attached file to see my folder structure. This is my root folder.
[eluser]Draft[/eluser]
Hello. I need a help. How can I write RewriteRule for changing utl from: http://website.com?a=1&b=2&c=3 to http://website.com/a/1/b/2/c/3 and problem in that I don't really know a count of variables. Thankyou |
Welcome Guest, Not a member yet? Register Sign In |