![]() |
codeigniter 3.1.9 with apache and php 7.2 - routing/redirect issues with sym link - 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: codeigniter 3.1.9 with apache and php 7.2 - routing/redirect issues with sym link (/showthread.php?tid=71073) Pages:
1
2
|
RE: codeigniter 3.1.9 with apache and php 7.2 - routing/redirect issues with sym link - BBT - 07-05-2018 (07-05-2018, 11:24 PM)jreklund Wrote: Hi again, those aren't sub-domains. These are: RE: codeigniter 3.1.9 with apache and php 7.2 - routing/redirect issues with sym link - jreklund - 07-06-2018 Can you double check how your URL's are generated? Right click and copy hyperlink. Do they say https://example.com/test1/select-product or https://192.168.1.2/test1/select-product "The action you have requested is not allowed." are a CSRF error message, try disable it. $config['csrf_protection'] = FALSE; Have you tried different browsers? Sometimes the browsers cache redirects you weird. RE: codeigniter 3.1.9 with apache and php 7.2 - routing/redirect issues with sym link - BBT - 07-08-2018 Hi jreklunk/Other valuable community members, Thank you for your response. It's gives me hope that with the help of this community we can fix this problem ![]() Steps involved to check the URL 1.First I browse manually to “https://example.com/test1/”. Please note – https://example.com is the base_url, and all pagination and web-page flow is working fine when I go directly to base_url. 2. I provide the form inputs for the application. URL generated for this form is “https://example.com/test1/” 3. When I press continue the URL address is supposed to change to “https://example.com/test1/select-product” but in this case it goes back to “https://example.com/select-product, and that is the problem I need to overcome. When I manually enter “https://example.com/test1/select-product” in the browser, web page is loaded correctly as expected. 4. URL’s are generated as https://example.com/test1/ or https://example.com/ not the IP when the $config['base_url'] = 'https://example.com/'. When I browse using the private IP/local IP by leaving base_url empty, everything is working fine. Below is web page directory structure and its mapping: Web root directory structure: /var/www/html/ ├── application ├── assets ├── test1-> /var/www/html/ ├── test2-> /var/www/html/ ├── index.php ├── system https://example.com points to /var/www/html https://example.com/test1 points to /var/www/html/test2 https://example.com/test2 points to /var/www/html/test2 /var/www/html/test1 is symbolic link to /var/www/html /var/www/html/test2 is symbolic link to /var/www/html "assets" directory has all the customisation for each pages inside test1 and test2. I found the below information on the internet: By default codeigniter 3 you will not be able to have sub folder in your default_route. You need to use a MY_Router.php Could this be the reason why I am facing this problem? If so , how could I achieve the expected result mentioned above? Hoping to hear from you soon. Thank you, BBT RE: codeigniter 3.1.9 with apache and php 7.2 - routing/redirect issues with sym link - jreklund - 07-09-2018 Quote:2. I provide the form inputs for the application. URL generated for this form is “https://example.com/test1/”Can you provide us with the code that process your <form>. I thought you had static <a> tags. RE: codeigniter 3.1.9 with apache and php 7.2 - routing/redirect issues with sym link - BBT - 07-09-2018 HI jreklunk, I do not have access to the code right now, so will add that later on. In the meantime, I was curious why the same form application process would work using private IP when base_url is set to empty?. I am confused how providing a URL in base_url field would break the working routing flow from before? Also, Is this statement true "By default codeigniter 3 you will not be able to have sub folder in your default_route. You need to use a MY_Router.php" Thank you again for your continuous support/response. RE: codeigniter 3.1.9 with apache and php 7.2 - routing/redirect issues with sym link - jreklund - 07-09-2018 Can't answer that one. If we had that answer, you wouldn't be here; with a problem. They mean this one: PHP Code: $route['default_controller'] = 'welcome'; It can't be: PHP Code: $route['default_controller'] = 'subfolder/welcome'; RE: codeigniter 3.1.9 with apache and php 7.2 - routing/redirect issues with sym link - BBT - 07-09-2018 Hi Jreklunkd, Below is the related code as found in home.php - the form that is presented on https://example.com/test1/ home.php PHP Code: Beginning of the code: Towards the end: PHP Code: <?=form_hidden(array('product_id' => isset($_GET['product_id']) ? $_GET['product_id'] : '','reseller_id' => $this->reseller->getResellerId()))?> Hope the above makes sense. Could this be related to "session" handling? I am totally clueless here, waiting for your response. ==================================== Also, while waiting for response, I have noticed below pattern and mentioning it here just incase that is related to the problem. I changed config for base_url and index_page as follows: PHP Code: $config['base_url'] = 'https://example.com/test1/'; Now, the image on the first loading page is not displayed with the below error logged in the application/logs file. PHP Code: ERROR - 2018-07-10 12:47:35 --> 404 Page Not Found: Assets/images please note, directory name is "assets" not "Assets" and it is in the root application folder. When I right click on the image and get the address "index.php", it seems to be retaining index.php as follows: https://example.com/test1/index.php/assets/images/reseller/test1/logo.png PHP Code: My .htaccess file is as follows: When I leave index.php page empty, then the images are loaded correctly and index.php is removed from the image URL. But I face the problem of routing as reporting in this ticket. Just wondering why image URL will not be loaded correctly when I configure "$config['index_page'] = 'index.php';" Cheers, RE: codeigniter 3.1.9 with apache and php 7.2 - routing/redirect issues with sym link - jreklund - 07-09-2018 I'm sorry but I needed the Controller code. My bad for not specifying it clearer. You are using site_url instead of base_url on your images. So index.php get's appended, and that's not a folder so your images can't be found. RE: codeigniter 3.1.9 with apache and php 7.2 - routing/redirect issues with sym link - BBT - 07-18-2018 Hi all, I managed to fix this problem by removing the "symbolic links" and creating independent directories. I then had to copy application, assets, system and index.php to test1 and test2 folder, and base_url in test1/config.php and test2/config.php were set as: test1/config.php ==> base_url= 'https://example.com/test1'; test2/config.php ==> base_url= 'https://example.com/test2'; Change web directory from: /var/www/html/ ├── application ├── assets ├── test1-> /var/www/html/ ├── test2-> /var/www/html/ ├── index.php ├── system To: /var/www/html/ ├── application ├── assets ├── test1 ├── test2 ├── index.php ├── system Thank you to everyone that responded to me in this forum. We do have a great community here. Cheers. |