Forum Moderators: phranque
<IfModule mod_rewrite.c>
RewriteEngine On
<Files process>
forcetype application/x-httpd-php
AcceptPathInfo On
</Files>
RewriteBase /CI-Directory
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /CI-Directory/index.php/$1 [L,QSA]
</IfModule>
I have a file named process.php in the /CI-Directory. I am trying to call this file without the .php extension like this:
[mywebsite.com...]
But keep getting 404 error:
I really hope someone can help me with this one..
2. The -d and -f checks are very server intensive. By careful coding of point one they could both probably be omitted.
We need to see an example of the URL that you advertise on the web, and the matching local filepath of the file inside the server that processes the request.
Your current example is unclear, and open to misinterpretation.
At present a URL request for
example.com/CI-Directory/process?param1=0 will be rewritten so that the server is looking for the data inside the server at /CI-Directory/index.php[b]/[/b]CI-Directory/process?param1=1 and that makes no sense at all. There's a load of redundant junk in the URL, and the "process" parameter is not being passed in any sensible way to the file "index.php". This needs a rethink. Define the operation of the URLs and the internal filepaths before starting to code anything at all.
This split discussion will end up confusing both you and us.
I am not pursuing the other thread any more.. and more keen on getting my outcome using forcetype approach (mentioned here).
My CI-Directory is here:
/www/CI-Directory/
My Files:
/www/CI-Directory/.htaccess
/www/CI-Directory/process.php
/www/CI-Directory/index.php
Other source files which need index.php to work: (index.php is acting as a Front controller here)
/www/CI-Directory/system
Don't know how to AVOID process.php being parsed by index.php. Unfortunately I am very green when it comes to htaccess rules.. still learning.