icon Learn how to get the most out of Surmunity - read our forum tips here! | Welcome! Please register to access all of our features.

» Surpass Web Hosting Forums » Discussions » PHP, MySQL » .htaccess, with PHP5

PHP, MySQL General PHP questions. Or go to our PHPsuexec Forum >>

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread
Old May 1st, 2008, 9:37 AM   #1 (permalink)
Senior Member
Super #1
 
FredFredrickson's Avatar
 
Joined in Nov 2003
Lives in New Hampshire
1,145 posts
Gave thanks: 3
Thanked 20 times
.htaccess, with PHP5

So Things started going all wacky when my shared account got upgraded to PHP5. I've gotten most of everything fixed, but one weird issue-

I have a .htaccess file with this:

Code:
<Files article>
SetHandler application/x-httpd-php
</Files>
Which would render the file "article" with no extension as a php file. Now it redirects to a 404. Any ideas ?
__________________
The Coding Blog - Follow along as we discover and discuss everything it takes to code an entire website, start to finish! [Latest Entry: 4/4/08 - Starting a Website]
FredFredrickson is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old May 1st, 2008, 9:39 AM   #2 (permalink)
DemonicAngel
Super #1
 
twirp's Avatar
 
Joined in Aug 2004
Lives in Wherever The World Takes Me
Hosted on Pass76
1,769 posts
Gave thanks: 24
Thanked 32 times
Rename it to article.php and use mod_rewrite to make /article go to /article.php?
__________________
You wear Vans so high school kids will think that you can skate. He wears Vans because he can skate. TwiRp wears Vans because they were on sale. Pass76 wants Vans.
twirp is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old May 1st, 2008, 9:51 AM   #3 (permalink)
Senior Member
Super #1
 
FredFredrickson's Avatar
 
Joined in Nov 2003
Lives in New Hampshire
1,145 posts
Gave thanks: 3
Thanked 20 times
Ok.. currently I've got urls like this

fredrickville.com/article/4/13/Title_of_Article

But the actual url is this: fredrickville.com/article?1=4&2=13&3=Title_of_Article

How do I do this with mod_rewrite ?
__________________
The Coding Blog - Follow along as we discover and discuss everything it takes to code an entire website, start to finish! [Latest Entry: 4/4/08 - Starting a Website]
FredFredrickson is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old May 1st, 2008, 10:56 AM   #4 (permalink)
Race Surpass
Super #1
 
MarkRH's Avatar
 
Joined in Jul 2006
Lives in Oklahoma City, OK
Hosted on sh102
1,176 posts
Gave thanks: 18
Thanked 85 times
Hmmm... this might work...

Code:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^article/([0-9]*)/([0-9]*)/([A-Za-z_0-9\)\(\-]*)$ article?1=$1&2=$2&3=$3 [L]
</IfModule>
if the file is actually called article.php then make the second article, article.php instead.
MarkRH is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old May 2nd, 2008, 10:52 AM   #5 (permalink)
Senior Member
Super #1
 
FredFredrickson's Avatar
 
Joined in Nov 2003
Lives in New Hampshire
1,145 posts
Gave thanks: 3
Thanked 20 times
That will require redoing a few scripts, I think at the moment- Any ideas on why my handler doesn't work anymore? Is there a new location for php now that it's 5? Is there a quick fix?
__________________
The Coding Blog - Follow along as we discover and discuss everything it takes to code an entire website, start to finish! [Latest Entry: 4/4/08 - Starting a Website]
FredFredrickson is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old May 3rd, 2008, 2:51 PM   #6 (permalink)
Surpass Fan
Seasoned Poster
 
Joined in Oct 2003
Lives in Tempe, AZ
Hosted on dime31
72 posts
Gave thanks: 0
Thanked 0 times
Try using application/x-httpd-php5 instead of application/x-httpd-php
__________________
Domain: BCIhosting.com Server: D31
Domain: BCIhosting2.com Server: Pass7
Domain: BCIhosting.org Server: Saprus
bcihost is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old May 4th, 2008, 7:57 PM   #7 (permalink)
Senior Member
Super #1
 
FredFredrickson's Avatar
 
Joined in Nov 2003
Lives in New Hampshire
1,145 posts
Gave thanks: 3
Thanked 20 times
and that little peice of magic is what I was looking for. Thanks!
__________________
The Coding Blog - Follow along as we discover and discuss everything it takes to code an entire website, start to finish! [Latest Entry: 4/4/08 - Starting a Website]
FredFredrickson is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On