![]() |
.htaccess question - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: .htaccess question (/showthread.php?tid=65610) |
.htaccess question - wolfgang1983 - 07-01-2016 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 RE: .htaccess question - PaulD - 07-01-2016 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/18902887/how-to-configuring-a-xampp-web-server-for-diffrent-root-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. RE: .htaccess question - wolfgang1983 - 07-01-2016 (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. RE: .htaccess question - PaulD - 07-01-2016 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. RE: .htaccess question - wolfgang1983 - 07-01-2016 (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 |