having issue site made in codeigniter is shifted to new domain - codeigniter

hey i have a running site which URL is below
http://www.buraksolutions.com/homelife/site/residential.html
the problem is when i shifted this site to other domain, there is index.php? coming in the URL which is causing a lot of problem, it does not loads most of data
http://nextcrawl.net/HomeLife/site/index.php?/welcome_controller.html
here is my .htaccess file
RewriteEngine on
#RewriteBase /kunden/homepages/8/d232327588/htdocs/consulnet/genetech/mockups/nextcrawl/homelife/site
#RewriteCond $1 !^(index\.php|resources|robots\.txt)
#RewriteCond %{REQUEST_FILENAME} !-f
# RewriteCond %{REQUEST_FILENAME} !-d
# RewriteRule ^(.*)$ /index.php/$1 [L]
# AddType x-mapp-php5 .php
#Options +FollowSymLinks
RewriteEngine On
RewriteBase /homelife/site
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|images|robots\.txt|css)
RewriteRule ^(.*)$ index.php?/$1 [L]

Take a look at the URL rewriting that's defined in your .htaccess file. It's possible that its configuration doesn't match with the new domain name, or mod_rewrite may not even be enabled on your new domain's server. I can't tell you more than that without looking at your setup, but here are some fantastic resources on URL rewriting with CodeIgniter:
http://codeigniter.com/user_guide/general/urls.html
http://codeigniter.com/wiki/mod_rewrite

Related

How to convert .htaccess to web.config?

I am realy lost here. I am used to work with linux server so I use .htaccess
Now I need to develop a project in windows server and I need to use some rewrite rules, etc. So I need to set the web.config file.
So I need help to convert my .htaccess rules to web.config
This are the rules:
RewriteEngine On
RewriteRule ^box/camp(.+)?/?$ /_box/access_box_files/camp$1
RewriteRule ^box/merchant(.+)?/?$ /box/access_box_files/merchant$1
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?url_tab=$1 [L,QSA]
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
UPDATE
RewriteRule ^box/camp(.+)?/?$ /_box/access_box_files/camp$1
In this case I need that whenever the URL is "/box/camp" there is access to "/_box/access_box_files/cam" and that all the information that comes in front of "(.+)?" "$1" is included. Without changing the URL in the browser, or forwarding the user.
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?url_tab=$1 [L,QSA]
In this case, any information that comes in the URL must be collected in a variable.
For example:
https:// website dot com/tab1/tab2/tab3
I will get the information in: $_GET['url_tab'] which would have the information: "tab1/tab2/tab3".
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
In this case it is to force the URL to be loaded with https.
Thank you all very much.

Codeigniter A3M Admin Controller

Hi I am trying to use CodeIgniter A3M.
I am trying to view the manage users and manage permission etc but keeps on saying error 404 I am the admin I have just created an account for my self.
This seems to be a problem with your CodeIgniter setup. All the links in A3M are already assumes that you have taken steps to remove the index.php from the path using .htaccess. You can read in the user guide on how to do that. In general you should have this in your .htaccess file in the root:
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
Also check that you have all other settings set correctly according to A3M.
I think you must code .htacess file like this
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]
Its working for me
My code .htacess
DirectoryIndex index.php
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|robots\.txt)
RewriteCond $1!^(index\.php|resource|system|user_guide|bootstrap|robots\.txt|favicon\.ico)
RewriteRule ^(.*)$ index.php?/$1 [L]

Codeigniter No input file specified

I know that this question has been asked maybe thousands of time before, I looked at most of them and could not fix for my case :s
I have a codeigniter framework installed on godaddy hosting company and i read that i have to create a .htacces file and put this code into:
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [QSA,L]
</IfModule>
But this does not fix for my case, is it that I have this site hosted under another domain?
for ex the structure of my ftp looks like below:
/
facelajm
studenti
fxclod
and I am trying to get the site following url www.facelajm.com/studenti which opens the main page fine, but when i try to login or reg it just returns me No input file specified.
Anyone could help me?
Seems that in certain configurations the CI core misses the rules, the .htaccess I'm using now:
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/system.*
RewriteRule ^(.*)$ index.php?/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?/$1 [L]
ErrorDocument 404 index.php
In my case (dev: a subfolder, prod: an "addon domain") the magic was provided by those two extra lines:
RewriteCond %{REQUEST_URI} ^/system.*
RewriteRule ^(.*)$ index.php?/$1 [L]
Source:
http://www.diegodicamillo.com.ar/blog/2012/09/19/no-input-file-specified-codeigniter-error-problema-resuelto/
From your question what i understand is you are running the codeignitor in a subfolder("studenti") of the domain("www.facelajm.com"). So the below .htaccess code will work.
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [QSA,L]
</IfModule>
And also don't forgot to change the baseurl in configuration file(application/config/config.php) like below.
$config['base_url'] = "http://www.facelajm.com/studenti"
The above .htaccess which you used in your question will work for a sub domain.
So you can also create a sub domain and map the folder to the sub domain and use the code which you used in your question(For Reference i added below).
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [QSA,L]
</IfModule>
And also don't forgot to change the baseurl in configuration file(application/config/config.php) to the new subdomain(assuming new sub domain as http://codeignitor.facelajm.com/) like below.
$config['base_url'] = "http://codeignitor.facelajm.com/"
Here is the .htaccess file i have on a godaddy and it works fine:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ index.php/$1 [L]
Your problem might be the RewriteBase line if codeigniter is not in the root.
Please try this code:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.)$ /index.php [L] or RewriteRule ^(.)$ index.php?/$1 [QSA,L]

htaccess file for codeigniter on subdomain virtualhost

i have problem about .htaccess file for my codeigniter installation.
On localhost this work fine, when i upload online its rewrite URL but the website not work.
this is my htaccess on localhost:
RewriteEngine On
RewriteBase /jCore_01/
#RewriteBase /
### Canonicalize codeigniter URLs
# If your default controller is something other than
# "welcome" you should probably change this
RewriteRule ^(welcome(/index)?|index(\.php)?)/?$ / [L,R=301]
RewriteRule ^(.*)/index/?$ $1 [L,R=301]
# Removes trailing slashes (prevents SEO duplicate content issues)
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)/$ $1 [L,R=301]
# Enforce NO www
#RewriteCond %{HTTP_HOST} ^www [NC]
#RewriteRule ^(.*)$ http://domain.tld/$1 [L,R=301]
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
online i have a problem:
i put this file on subdomain jcore.miodomio.com and it rewrite URL but not work
example:
without htaccess it's work:
jcore.miodominio.com/index.php/en/home
with htaccess
jcore.miodominio.com/en/home
Not Found
The requested URL /en/home was not found on this server.
can anyone help me? suggestion?
regards
Denny
Try change your htaccess to:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1 [L]
Somethings to consider.
Did you enable Apache rewrite module?
If enabled check whether your virtual host file is configured properly So to make sure its hitting .htaccess or try putting some dump on .htacess , So if its hitting .htaccess than you should get an 500 server error.
If you are not getting error than its mostly the problem in your host settings.

mod_rewrite file check with extention

Here is my .htaccess for simple url rewriting for any MVC architecture.
Options +FollowSymlinks
RewriteEngine On
RewriteBase /personal/site/
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
Every thing is working only one exception rises. On the root where index.php exists i created a file generator.js, i also do have a controller named generator.
So for a request, http://localhost/personal/site/generator/css,
it must rewrite it to http://localhost/personal/site/index.php/generator/css
But it is rewriting it to http://localhost/personal/site/generator.js/css
How to resolve this scenario?
Turn off multiviews.
Options -MultiViews

Resources