Netbeans still showing root folder - codeigniter

I'm starting a new Codeigniter project inside of Netbeans 7.3.1 and have the following set up for my file structure.
I have in the project properties set up as the web root is pointed to public_html inside of the text box. I also have this for my htaccess file as well as I have removed index.php from the ci config file.
My problem is that when I go to localhost/MyProject it still shows the foot folder and I don't know why.
Is there anyone that sees a mistake I have made somewhere.
-root
-application
-system
-public_html
-assets
.htaccess
index.php
Options -Indexes
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
#Removes access to the system folder by users.
#Additionally this will allow you to create a System.php controller,
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ index.php?/$1 [L]
#When your application folder isn't in the system folder
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
#Checks to see if the user is attempting to access a valid file,
#such as an image or css document, if this isn't true it sends the
#request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
# If we don't have mod_rewrite installed, all 404's
# can be sent to index.php, and everything works as normal.
# Submitted by: ElliotHaughin
ErrorDocument 404 /index.php

Out of the box Netbeans doesn't come with CodeIgniter support, but that can easily be solved by installing the appropriate plugin:
https://kenai.com/projects/nbphpci/pages/Home
Due to the specific structure of a CodeIgniter project telling Netbeans that a CodeIgniter project is just another php project won't work correctly.
The detailed procedure to install this plugin can be found on their Wiki or here. Usage is explained here.
I think that you will have to restart a new project and properly activate CodeIgniter support in the project setup wizard, and that should be it.

Related

Laravel website 'uploaded on shared hosting' is showing directory structure instead of my specified web routes

I've uploaded the project on a shared hosting and it is showing the complete directory structure of the project.
I've searched for the solutions and changed my .htaccess file. This is my .htaccess file now:
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
but it is still showing the same directory structure. Any help would be highly appreciated.
Laravel is not designed to be run on shared hosting. You'll have to manually change its structure to run it on shared hosting.
Follow this article: https://medium.com/laravel-news/the-simple-guide-to-deploy-laravel-5-application-on-shared-hosting-1a8d0aee923e
Though I will recommend to buy a private server for laravel.

Change Laravel app on shared hosting root directory

We have an added domain on a shared hosting. This domain is not the main hosting domain, but an added one that points to directory that matches the domain. The app was installed with a one click installer inside a dir like
ourdomain.com and Laravel public directory is accessed like
ourdomain.com/public
I need to use .htaccess to make /public the root of ourdomain.com and at the same time /public, so the project files and folders are protected as well. Can someone help show me how to do this with .htaccess?
If you do not have the access to change the settings in anything like CPANEL or similar then you can do it like this via .htaccess
RewriteEngine on
RewriteCond %{HTTP_HOST} ^ourdomain.com$ [NC,OR]
RewriteCond %{HTTP_HOST} ^www.ourdomain.com$
RewriteCond %{REQUEST_URI} !public/
RewriteRule (.*) /public/$1 [L]

How to remove index.php file from codeigniter

I referred the CodeIgniter Site and also checked various sites for information on how to remove index.php file from Mac OS X 10.10. But still index.php is unavoidable. I need steps to remove index.php from CodeIgniter on Mac OS 10.10.
This is working:
localhost/jenny/Learn/index.php/about
This is not working:
localhost/jenny/Learn/about
As long as you are running apache the operating system should not make a difference in this case.
You need to create a .htaccess file within the your root web directory (this is the directory where the index.php file is located) and within the .htaccess file you will want to include the following:
RewriteEngine On
RewriteOptions inherit
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]
This will allow you to utilize the second url you have posted as it will determine if the requested resource is located within the webroot and if not then redirect to the index.php file without it needing to be included in the url.
If you are not running a different web server then the rewrite rule will be different but the principle is the same. Send all requests to index.php if not resource does not live in web root.
open path:/application/config/config.php
find : $config['index_page']='index.php'
replace : $config['index_page']=''

Using Codeigniter on localhost

I am new with codeigniter. I have recently started work on a project which is developed in codeigniter.
I have downloaded the project and worked on it locally and then upload the updates to live.
The issue is that when i run it locally to check e.g. http://localhost/example/index.php/home or http://localhost/example/ it directly move to the live website www.example.com/index.php/home instaed of http://localhost/example, I also change the base_url in application/config/config.php.
Please assist me.
save this in .htaccess
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]

Rewrite URL on Glassfish with Quercus' PHP

I have Glassfish 3 server and have added Quercus 4.0.7 to to be able to run PHP applications on it. Everything works perfectly with it. Now I'm trying to run Question2Answer application on my server. I was able to open application but it's not allowing me to navigate from page to page because they are using .htaccess file to rewrite the URL. I was wondering how do we rewrite the URL in this case?
Here is what Question2Answer's .htaccess has inside:
DirectoryIndex index.php
RewriteEngine On
#RewriteBase /your-sub-directory
RewriteCond %{REQUEST_URI} ^(.*)//(.*)$
RewriteRule . %1/%2 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ index.php?qa-rewrite=$0&%{QUERY_STRING} [L]
Do you have any solutions for that?
Use Tuckey's UrlRewriteFilter (which is inspired by mod_rewrite and offers similar functionalities) to implement the rewrite rules. Basically, you'll have to:
Get Quercus's war and unpack it
Download the filter and unpack it inside Quercus (this will put the filter jar inside WEB-INF/lib and the urlrewrite.xml under WEB-INF).
Declare the filter in the web.xml (see the install instructions).
"Port" your rewrite rules to the urlrewrite.xml file.
Repackage and deploy the war (or deploy it as an exploded archive).
The post Drupal on Glassfish with clean urls using Url Rewrite Filter discusses this approach. Adapt it to your needs.

Resources