Htaccess issue (The page isn't redirecting properly) |
[eluser]Ninjabear[/eluser]
I've got my Code Igniter installation working now as per previous post, but the htaccess file is not working. I'm just using the recommended declaration of: Code: RewriteEngine on When I type www.danielsportfolio.co.uk/codeigniter/ The browser just hangs for ages and then gives me the message: Code: The page isn't redirecting properly If I add in the index.php to the end like this www.danielsportfolio.co.uk/codeigniter/index.php then the page will load fine. If i add the main controller (in my case main) then it gives me the error as well. How do I fix this please?
[eluser]pickupman[/eluser]
Is the .htaccess file in the /codeigniter/ folder? And try clearing your browser's cache. I have had this issue when editing the .htaccess file, I had to clear the browser's cache then refresh the page.
[eluser]Ninjabear[/eluser]
[quote author="pickupman" date="1270537920"]Is the .htaccess file in the /codeigniter/ folder? And try clearing your browser's cache. I have had this issue when editing the .htaccess file, I had to clear the browser's cache then refresh the page.[/quote] Yes it is the htaccess in the code igniter folder. I have already tried clearing the browser cache but it doesn't solve the problem. Is there a way of resetting the .htaccess file so that it doesn't take instructions from further up the tree?
[eluser]rogierb[/eluser]
By the look of your url you have CI installed in a subfolder. Code: RewriteRule ^(.*)$ /index.php/$1 [L] If you want it to piont to www.danielsportfolio.co.uk/codigniter/ you need a Rewrite Base Code: RewriteBase /codeigniter/ You need to change the rewrite rule aswell, remove the slash: Code: RewriteRule ^(.*)$ index.php/$1 [L]
[eluser]Ninjabear[/eluser]
[quote author="rogierb" date="1270575309"]By the look of your url you have CI installed in a subfolder. Code: RewriteRule ^(.*)$ /index.php/$1 [L] If you want it to piont to www.danielsportfolio.co.uk/codigniter/ you need a Rewrite Base Code: RewriteBase /codeigniter/ You need to change the rewrite rule aswell, remove the slash: Code: RewriteRule ^(.*)$ index.php/$1 [L] Excellent help, it's working now. The only instance it doesn't work is if I put something like: Code: www.danielsportfolio.co.uk/codeigniter It works in this instance though: Code: www.danielsportfolio.co.uk/codeigniter/
[eluser]pickupman[/eluser]
The trailing slash tells your root folder that /codeigniter/ is a folder, and to load the default index file (ie index.php).
[eluser]Ninjabear[/eluser]
I made this topic ages ago but I have further htaccess issues. I have looked at tutorials but I'm still no closer. At the moment my site is at the root of my domain. I tried using the default htaccess file but with js and css added so I can keep them in the root: Code: RewriteEngine on When loading the site it loads fine and all pages will load but only if I add index.php/ to the end of the domain name. No errors in log file or page.
[eluser]pickupman[/eluser]
Some servers want a question mark in the rule. Code: RewriteRule ^(.*)$ index.php?/$1 [L]
[eluser]Ninjabear[/eluser]
[quote author="pickupman" date="1300497170"]Some servers want a question mark in the rule. Code: RewriteRule ^(.*)$ index.php?/$1 [L] You legend! Thanks, works a treat, this thing's been giving me a headache all day.
[eluser]pickupman[/eluser]
Great...one of the great things of programming...one single character can waste hours. |
Welcome Guest, Not a member yet? Register Sign In |