I have an application written in Codeigniter 2.1.4 which works on my local machine installed with WAMP.
When moving the project over onto a production server, Codeigniter routing stops working. The login form actions a controller method, but instead I get routed to the home page of the website. The same happens if I manually try to enter any part of the web app, even though I have redirect logic for not being logged in to the app.
My production server has IIS6 installed and IsapiRewrite4.
I've tried copying all the rewrite rules from the .htaccess file that comes with CodeIgniter into an IIRF.INI file but I just can't get it to work.
These are the default .htaccess rules:
RewriteEngine on
RewriteCond $1 !^(index\.php|public|\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?$1
I've read that you can paste that into an IIRF.INI file and it should work but had no luck with it.
Also, I'm not exactly sure where to put the IIRF.INI file, I was guessing at the CodeIgniter root directory where the other .htaccess is.
I also noticed that there are other .htaccess files, one in the /core folder, one in the /application folder, and one in the /application/cache folder.
Do I need to restart IIS on the production server when changing/adding IIRF.INI files?
I've also tried the rules suggested here with no luck: Configure htaccess to work with IIRF on IIS6 - codeigniter
Can anyone help??? Maybe it's not even a Rewrite Issue, I'm not sure... Please let me know if you need any other information.
Isapi Rewrite is a product by Helicon Tech. Helicon products use slightly different configuration files to Ionic IIRF isapi rewrite module which uses the IIRF.ini files. I think you've got your products mixed up.
See Helicon's documentation at http://www.helicontech.com/isapi_rewrite/
Alternatively Ionic ISAPI rewrite module is available at https://iirf.codeplex.com/
Related
I have migrated my CRM application (developed PHP) from hostgator VPS to hostinger,
My application Folder structure is crm\leadstracer1.1{other php files}. I had kept a .htaccess file in crm folder, to avoid '.php' extension on URL, that was working fine on hostgator. But after migrating hostinger its not getting work, I am using CentOs server, I tried instructions from following links
Linux CentOS 7 - Configuration of httpd.conf file through .htaccess
Codeigniter URL rewriting .htaccess is not working on CentOS
But nothing get work out.
Please see the content of my .htacess file.
RewriteEngine On
RewriteRule ^$ leadstracer1.1/views/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ leadstracer1.1/views/$1.php
It would be great if someoone help me regrding this
Thanks
Have you correctly configured your httpd.conf or virtualhost conf file to allow the use of htacces file?
Usually you have to change it to make it works.
There should be a directive called AllowOverride none that must be configured as All for example
I have the following setup:
Wamp server with Apache 2.4.27, PHP 7.1.8
Then I am using our own CMS to develop a website.
It is installed in the www folder under PeerCMS$/test/ ($ to hide it in wamp overview)
Now I am browsing to http://localhost/PeerCMS$/test/structure
This is working fine. It displays our CMS stucture page to generate a database. When we save this, it will be saved to stucture.json in the same test folder.
After this, http://localhost/PeerCMS$/test/structure isn't reachable anymore. 404 Not Found.
If we remove the .json file, it is reachable again.
This is our .htaccess:
RewriteEngine On
RewriteBase /PeerCMS$/test/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . index.php [L]
I think that one is ok.
Does anyone know where to look for this?
I'm working on a PHP web app which will route every incoming request to the index.php same as WordPress or Joomla.
Following .htaccess is used to implement the feature.
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
It is working on Wamp server [Windows] and IIS but when I migrate the app to the Ubuntu 16.04.02 [Apache 2.4.18, php7.0.18, Google Cloud Engine], it stops working for some custom extension file. It still working on normal php files thought.
I created a folder called service to put the web service php files and named the files as ****.svc.php and used with ****.svc url. It was working fine before but it is not on the Ubuntu and shown the following error.
Not Found
The requested URL /service/retrieve_opened_rs.svc was not found on this server.
Apache/2.4.18 (Ubuntu) Server at ******* Port 80
I believe this is the configuration issue but I still cannot figure out how to fix after 3 days. Please help me. Thanks in advance.
You probably have the Multiviews option enabled. This never behaves well along with rewrite rules, especially with "double" extensions like .svc.php
Add this at the top of your .htaccess file and that should take care of it:
Options -Multiviews
You might have to tweak your AllowOverride directive (from the main Apache conf) if you don't have the rights to modify Options from an .htaccess file.
I am trying to learn fuelPHP and I came form a CI background. I am using this tutorial so that I can familiarize myself on this.
http://net.tutsplus.com/tutorials/php/getting-started-with-the-fuel-php-framework/
My problem is in step 2. When I access my simple controller
http://localhost/fuel/public/index.php/hello
I get a 404 error.
*fuel is the directory of this freshly installed fuelPHP on my localhost.
When I set this to be my default route, the controller works.
Did something change in the new version that prompted this?
Here is my .htaccess on the /public/ folder.
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
Thanks.
You are making it very complicated for yourself by installing FuelPHP like this.
It has been designed in such a way that the 'public' folder is your webservers document root, which means all fuel stuff is outside your document root, and the .htaccess is directly inside your document root.
By not only installing it entirely inside your document root, but also in a subfolder of that document root, you need to modify your rewrite rules. Start by adding
RewriteBase /fuel/public
to the one in public, and see if that helps. Also, this .htaccess is made for "standard" apache type installations. If you run anything else you might need a different .htaccess. If you use fcgi for example, get the .htaccess from the 1.4/develop repo, it's more fault tolerant towards your webserver type.
Final remark: you should not use localhost as hostname. It's an illegal name in a lot of RFC's, one of them being the one that documents the use of cookies. You'll have all kinds of session issues with some browser (versions) if you use "localhost". Instead, setup virtual hosts (a better solution then subfolders anyway), and use a hostname like "mymachine.local".
I'm using the wamp package(Apache server) in my windows xp. After i followed the steps in the url click here i'm not able to access the different language. The problem i'm facing in the .htaccess file. under the www folder i put all my wordpress files in the name wsa26-4. So the file structure will come like this wamp/www/wsa26-4/wordpress files. So i used the following code in my htaccess file.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wsa26-4/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
But the problem i was facing is when i click the language switcher flag say german then it's redirecting to me the default wamp server page.(http://localhost/wsa26-4/de-->localhost index page).. How i can fix this issue??
It's difficult to debug the .htaccess file like this.
What I always do is go to WordPress->Settings->Permalinks and save from there. Then, either WP can update the .htaccss file itself or it gives me the text to paste in.
In order for WPML to use languages in directories, 'fancy permalinks' need to work. You should test it first without WPML. Set a permalink structure such as 'Month / Day / Postname' and see that it works. For this, the server's rewrite module should work.
The .htaccess file needs to have the rewrite engine enabled (see the IfModule declaration). You should check if your local Apache server has this module enabled and if not, enable it.
Then, when this is OK, you can safely enable WPML's language directories option and it should run without any issues.