.htaccess question |
I have my codeigniter 3.0.6 project structure like
Code: www > Question 1: Where should I put my htaccess? In the public? Question 2: Currently I have to type in http://localhost/codeigniter/public/ to get to the home page On my htaccess is there away to be able to have it point to this http://localhost/codeigniter/ PHP Code: Options +FollowSymLinks
There's only one rule - please don't tell anyone to go and read the manual. Sometimes the manual just SUCKS!
Q1. Normally yes. If you are addressing /codeigniter/ then rules from the route .htaccess will apply, and can be modified or further rules applied by the .htaccess file in the /codeigniter/ folder. A CI remove index.php htaccess should be in the CI root folder, in your case /codeigniter/
Having said that it all depends what you are doing. You can apply rules in the route .htaccess for other subfolders too. Q2. You can change the webroot for Xampp (assuming you are using that) in their config files. Here is a handy stack overflow answer about it: http://stackoverflow.com/questions/18902...-directory Personally I would not do this, but just accept that in development locally you have the additional folder in URL's. If you set your base_url in the config this is just one setting to change when you upload it to a live site. Hope that helps in some way, Paul.
(07-01-2016, 12:55 AM)PaulD Wrote: Q1. Normally yes. If you are addressing /codeigniter/ then rules from the route .htaccess will apply, and can be modified or further rules applied by the .htaccess file in the /codeigniter/ folder. A CI remove index.php htaccess should be in the CI root folder, in your case /codeigniter/ Thank you I thought it could be done with htaccess. But I think v host easier.
There's only one rule - please don't tell anyone to go and read the manual. Sometimes the manual just SUCKS!
Sorry, I did not mean it cannot be done. I believe a rewrite rule on the .htaccess in your webroot can be used to rewrite everything to your /codeigniter/ folder. Only that would stop everything in other folders working, and sort of defeats the point. You may as well archive all the others and put your current project in your current web root.
(07-01-2016, 12:55 AM)PaulD Wrote: Q1. Normally yes. If you are addressing /codeigniter/ then rules from the route .htaccess will apply, and can be modified or further rules applied by the .htaccess file in the /codeigniter/ folder. A CI remove index.php htaccess should be in the CI root folder, in your case /codeigniter/ I found out how now Code: RewriteEngine on
There's only one rule - please don't tell anyone to go and read the manual. Sometimes the manual just SUCKS!
|
Welcome Guest, Not a member yet? Register Sign In |