To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here
PHPBuilder.com  
 

 

Go Back   PHPBuilder.com > Tools > Zend Studio

Zend Studio Looking for help with Zend Studio? This is the place.

Reply
 
Thread Tools Rate Thread Display Modes
Old 07-09-2008, 10:11 AM   #1
teguh123
Senior Member
 
Join Date: Aug 2006
Posts: 199
.htaccess in zend studio

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?
__________________
Learn how to make many kids at http://GeneTips.com
teguh123 is offline   Reply With Quote
Old 07-09-2008, 12:19 PM   #2
bpat1434
NMaOtBG
 
bpat1434's Avatar
 
Join Date: Oct 2004
Location: Around 255.255.255.0
Posts: 8,093
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?
bpat1434 is offline   Reply With Quote
Old 07-09-2008, 12:33 PM   #3
teguh123
Senior Member
 
Join Date: Aug 2006
Posts: 199
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

# BEGIN WordPress

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress
__________________
Learn how to make many kids at http://GeneTips.com
teguh123 is offline   Reply With Quote
Old 07-09-2008, 12:36 PM   #4
bpat1434
NMaOtBG
 
bpat1434's Avatar
 
Join Date: Oct 2004
Location: Around 255.255.255.0
Posts: 8,093
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.

Code:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* /index.php [L]
bpat1434 is offline   Reply With Quote
Old 07-09-2008, 01:44 PM   #5
teguh123
Senior Member
 
Join Date: Aug 2006
Posts: 199
Oh okay.
__________________
Learn how to make many kids at http://GeneTips.com
teguh123 is offline   Reply With Quote
Old 07-09-2008, 01:46 PM   #6
teguh123
Senior Member
 
Join Date: Aug 2006
Posts: 199
Still doesn't work.

My .htaccess is now like this


# BEGIN WordPress

<IfModule mod_rewrite.c>
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress
__________________
Learn how to make many kids at http://GeneTips.com
teguh123 is offline   Reply With Quote
Old 07-11-2008, 01:28 AM   #7
teguh123
Senior Member
 
Join Date: Aug 2006
Posts: 199
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
__________________
Learn how to make many kids at http://GeneTips.com
teguh123 is offline   Reply With Quote
Old 07-11-2008, 02:02 AM   #8
bretticus
Super Geek
 
bretticus's Avatar
 
Join Date: Apr 2002
Location: UT USA
Posts: 1,579
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...
Quote:
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...
Code:
$ 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?
__________________
When in doubt, read the manual: PHP MySQL
For beginners: PHP 101 PHP + MySQL 101 Google
Forum etiquette.: See FAQs (Typically found in sticky posts: top posts)
Avoid asking questions like: "It's not working..." (Describe how it's not working!) "Do you know of a script..." (This is a forum for PHP developers.)

Last edited by bpat1434; 07-11-2008 at 08:01 AM.
bretticus is offline   Reply With Quote
Old 07-11-2008, 08:04 AM   #9
bpat1434
NMaOtBG
 
bpat1434's Avatar
 
Join Date: Oct 2004
Location: Around 255.255.255.0
Posts: 8,093
Quote:
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):
Code:
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}).
bpat1434 is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 03:28 PM.






Acceptable Use Policy

internet.comMediabistrojusttechjobs.comGraphics.com

WebMediaBrands Corporate Info


Advertise | Newsletters | Feedback | Submit News

Legal Notices | Licensing | Permissions | Privacy Policy


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.