I have a CodeIgniter website. I uploaded it but its not redirecting to any other page. Here is my config file:
$config['base_url'] = 'http://www.fantastictravels.co/';
$config['index_page'] = '';
$config['uri_protocol'] = "QUERY_STRING";
Here is my htaccess file:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?$1 [L]
I had the same problem once. Using godaddy please upgrade your php version.
follow the link below to help you change php version in Godaddy. https://uk.godaddy.com/help/view-or-change-your-php-version-16090. Hope this will help.
You likely need to adjust your .htaccess file. Here are a few similar questions via Stack Overflow that might help your cause:
Codeigniter .htaccess in godaddy
Puzzled using codeigniter on shared hosting server
Codeigniter htaccess not working on godaddy
Problem with CodeIgniter and URI on GoDaddy servers
Within those three articles, you will see a few GoDaddy-specific references to the .htaccess rules. Hope this helps.
Related
I have a website with the name of "http://wowriters.com/" but that website is also accessable from "http://beeelkazi33813.ipage.com/writers/".
I want that my "http://wowriters.com/" website should not be accessible from "http://beeelkazi33813.ipage.com/writers/".
Please help me.
Thanks in advance.
Inside your site root directory (/writers/), add this block rule for 2nd domain:
RewriteEngine On
RewriteCond %{HTTP_HOST} =beeelkazi33813.ipage.com
RewriteRule .* http://wowriters.com/$0 [L,R=301,NE]
removing index.php on codeigniter are found easy using .htaccess,
RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
but when needed to be on other ports? it doesn't work, why? and how to make it work?
in http://localhost:85/foldersite seems working, but when calling a controller it's not found, such as http://localhost:85/foldersite/mycontroller
yet the same .htaccess when deployed in server hosting these are just fine calling the controller because it didn't use any different port than 80 ..
and in file config.php and route.php already set as follows
$config['base_url'] = 'http://localhost:85/foldersite';
$config['index_page'] = '';
$config['uri_protocol'] = 'REQUEST_URI';
$route['default_controller'] = 'welcome';
$route['404_override'] = '';
I think I just have the same issue as yours, and I managed to solve it just about couple of minutes ago.
Please consider to read this documentation page: CodeIgniter URLs. Under the section of "Removing the index.php file" you'll be informed about Apache mod_rewrite enabled.
Then, I implemented a tutorial from Digital Ocean and it worked well. Just try it.
In addition, I have .htaccess content that exactly the same with yours. Except, I didn't modify any value from $config['base_url'] and $config['index_page'].
I hope it helps.
I use CodeIgniter 3.1 in my project. Everything is running well in localhost, but when I upload to server, all controllers that using redirect didnt work. It only shows blank page. Here my htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]
</IfModule>
Please, help me find this solution. Does CI version is the main problem? or the htaccess itself? This is my first time upload my project to server and I hope I didnt miss something important .. thanks
[EDITED]
I use another server, it works fine. Maybe the problem is in the server.
[EDITED]
Horray... Problem solved. Just put ob_start() at the begining every .php.
(more information , visit http://kakaeriel.com/mengatasi-cannot-modify-header-information/)
Thanks for everyone who helped me find this solution.
I assume your host could have same config as Godaddy's. You could try this https://github.com/bcit-ci/CodeIgniter/wiki/Godaddy-Installation-Tips
In /application/config/config.php set $config['base_url'] like this
$config['base_url'] = 'http://[hostname]/'; //like www.google.com
My Drupal 6 installation was installed via a server installation profile. I need to change the base URL from example.com to dev.example.com.
I've already changed this in settings.php and baseurl.php. There is no individial .htaccess file for this site. What do I do here? Should I create a new .htaccess file or what?
Yes, You have to create new .htaccess file and include this code at the bottom
RewriteEngine On
RewriteCond %{HTTP_HOST} !oldexample.com$ [NC]
RewriteRule ^(.*)$ http://www.newexample.com/$1 [L,R=301]
hope it will help you!!.
Right now i'm working on a webshop project in codeigniter.
In the end there will be multiple webshops on subdomains, and a frontpage on the main domain.
It's supposed to be all dynamic so that the webshops get their own subdomains.
The shop information is in the database. Lets say I have a mysql table which contains info like this:
webshop: Bobs shop
webshop_subdomain: bobsshop
And so on.
Now in a .htaccess file I want to make a rewrite rule so that bobsshop.mydomain.com will be rewritten to mydomain.com/bobsshop/ since i'm working in Codeigniter with controllers.
You should bear in mind that the index.php also has to be rewritten out and there should also be the possibility to make subpages like bobsshop.mydomain.com/contact/
I will make a php script which will check if the subdomain exists in the database and if it doesn't exist then the visitor will see a 404.
My DNS setup looks like this ATM:
mydomain.com xxx.xxx.xxx.xxx
*.mydomain.com xxx.xxx.xxx.xxx
Where xxx.xxx.xxx.xxx is my server IP.
I've really never worked with htaccess / mod_rewrite before.
Can it be done? And are there anyone who can help me make this?
Sorry for my English. I hope you understand what I'm trying to do.
Thanks in advance
RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{HTTP_HOST} ^((?!www\.)(?!mydomain\.com)[^\.]+)\.
RewriteRule ^(.*)$ http://www.mydomain.com/index.php?/%1/$1 [L]
Input URL - http://adasd.mydomain.com/test
1 RewriteCond %{HTTP_HOST} ^((?!www\.)(?!mydomain\.com)[^\.]+)\.
This condition was met
2 RewriteRule ^(.*)$ http://www.mydomain.com/index.php?/%1/$1 [L]
This rule was met, the new url is http://www.mydomain.com/index.php?/adasd/test
The tests are stopped, using a different host will cause a redirect
Output URL - http://www.mydomain.com/index.php?/adasd/test
You can then remove the index.php from the URL by
Open config.php from system/application/config directory and replace
$config['index_page'] = "index.php" with $config['index_page'] = ""
Implementing the above .htaccess file
In some case the default setting for uri_protocol does not work properly. To solve this problem just replace $config['uri_protocol'] = "AUTO" with $config['uri_protocol'] = "REQUEST_URI" in system/application/config/config.php