Hello,
I used a certain type of .htaccess that redirect all url to index.php
That doesn't work in zend studio though.
What's wrong?
Hello,
I used a certain type of .htaccess that redirect all url to index.php
That doesn't work in zend studio though.
What's wrong?
Define "doesn't work". As in you're doing the profiling or debugging of your scripts and requests don't get filtered through the .htaccess?
If I go to http://localhost/somedirectory/index.php the program works
If I go to http://localhost/somedirectory/whatever/something.htm I got a 404 error saying that there is no such file.
It's true that there is no such file. However, I have a .htaccess files there
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
So you only want to catch those requests that aren't valid files or directories? I would venture a guess as to say you might need to remove the RewriteBase from it.
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* /index.php [L]
Oh okay.
Still doesn't work.
My .htaccess is now like this
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
Still doesn't work.
My .htaccess is now like this
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
That is the same .htaccess I used in my sites. In my sites it's workin fine.
http://domainname.com/whatever will just act as if I am accessing http://domainname.com/index.php
I think the easiest way to do this (especially since you may not have access to the apache config files, just .htaccess) is to use the Files directive and ForceType
<Files articles>
ForceType application/x-httpd-php
</Files>
http://domainname.com/articles/whatever will just be parsed (same page) as http://domainname.com/articles.
If you have access to the apache config files, I believe you can use the Location directive to stipulate the virtual root...
http://domainname.com/whatever will just act as if I am accessing http://domainname.com/index.php
I suppose I should point out that you have to have a file called "articles" in the example with the Files directive. Zend Studio can be configured to read a no extension file as a PHP file. Also, you can create an articles.php file (for updating/writing) and then just create a sym link like...
$ ln -s articles.php articles
Also, I dunno what type of Apache server Zend Studio implements. I can't debug in the browser unless I use remote debugging. What are you using?
Also, I dunno what type of Apache server Zend Studio implements.
It uses whatever Apache you want (you can install it, or you can have Zend install it).
I honestly don't know. I have a linux box with Apache 2.2.x installed, and have this in my .htaccess and it works perfectly fine (as expected):
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ index.php?404 [L]
I'm going to guess you also posted this at Wordpress, as when I searched for things, that came up as well (see: RewriteCond %{REQUEST_FILENAME}).