mod rewrite - removing index.php from the URL help please |
[eluser]kdawson[/eluser]
Hi all, any help with this would be greatly appreciated: I have a website where I have my CodeIgniter application i.e. : mywebsiteaddress.com/myapplication/index.php my page URL's are looking like this : mywebsiteaddress.com/myapplication/index.php/login/signup/ So I follow the instructions here >>> http://codeigniter.com/wiki/mod_rewrite/ to "take away “index.php” from your CI application URLs" I have followed the instructions to the letter My URLS's now look like this: mywebsiteaddress.com/myapplication/login/signup/ But I get a "404 Not Found The server can not find the requested page" Any way to narrow down what might be wrong? Is there a httaccess file I can use to prove or show that my rewrite engine is indeed on and that is not the issue? ---- Come to think of it, I have an even bigger question - Is there a way I can just call the whole library and functions in to any php page??? Even though it is late and I'm sure I'm sounding like a moron right now, I'm sure you know what I mean. How do I just get it all working in lets say ... mywebsiteaddress.com/Any_Page_I_Want.php ??? Why can't I just do that? Is that even possible to call all of the classes and everything in to there without that being my default_controller ??? And then I can just call it all again into a file mywebsiteaddress.com/WhateverDirectory/Any_Page_I_Want.php ??? I understand the whole DMV and how that works with the URL, but if your left jumping through hoops to get the URLS to look like what you want and have a directory structure that you want... then the framework seems like a bigger hassle than it was worth. It is late and I am really tiered, (sorry if it sounds like a rant) but maybe someone can put me on to a way to simply call these classes and helpers and whatnot into any page that I want. Thanks very much. Regards Thank you. Regards
[eluser]ηυмвєяσηє[/eluser]
1. http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html 2. http://ellislab.com/codeigniter/user-gui...uting.html
[eluser]XMadMax[/eluser]
Try this basic example: .htaccess: Code: <IfModule mod_rewrite.c> Also, remove 'index.php' from the config.php file as: "$config['base_url'] = '';
[eluser]kdawson[/eluser]
Hi Summer Student. Thanks but still the same. I did exactly what you have above and the "index.php" is gone, but still the error:. " 404 Not Found The server can not find the requested page: " How do know the rewrite rule works? Is there a simple .httaccess that proves if it is on and working... thereby eliminating one possible problem?
[eluser]ηυмвєяσηє[/eluser]
it is possible to mod_rewrite is not active. Check your apache settings. You can check it with running : <?php phpinfo(); ?> search for mod_rewrite, it should be in the 'Loaded Modules'.
[eluser]kdawson[/eluser]
Hi Grad Student, Is see this: Loaded Modules core mod_authn_file mod_authn_default mod_authz_host mod_authz_groupfile mod_authz_user mod_authz_default mod_auth_basic mod_include mod_filter mod_log_config mod_logio mod_env mod_expires mod_headers mod_setenvif mod_version mod_proxy mod_proxy_connect mod_proxy_ftp mod_proxy_http mod_proxy_scgi mod_proxy_ajp mod_proxy_balancer mod_ssl prefork http_core mod_mime mod_status mod_autoindex mod_asis mod_info mod_suexec mod_cgi mod_negotiation mod_dir mod_actions mod_userdir mod_alias mod_rewrite mod_so mod_auth_passthrough mod_bwlimited mod_fpcgid mod_php5 and "mod_rewrite" is there like 6th from the last.
[eluser]ηυмвєяσηє[/eluser]
Ok. If so, your .htaccess file is not for your folder structure. Can you try this. Code: <ifmodule mod_rewrite.c="">
[eluser]kdawson[/eluser]
Hi, Thank you but that did not work either. It just throws a 404 not found... Not sure what else I can do. I'm sure I have followed all of your instructions without making a mistake.
[eluser]ηυмвєяσηє[/eluser]
i dont know about your folder structure. If your site is placed in subfolder specify the path in the “RewriteBase /subfolder/” line. “RewriteBase /myapplication/” for mywebsiteaddress.com/myapplication/index.php/login/signup/ i think you have different folder name. u must change it.
[eluser]kdawson[/eluser]
My folder structure is like this: http://websitedomain/~Project_Folder/ind...in/signup/ in /~Project_Folder/ I have the CodeIgniter folders: /application/ /system/ /user_guide/ and in /~Project_Folder/ is where I have been applying the .htaccess rules. |
Welcome Guest, Not a member yet? Register Sign In |