Jump to content


Photo

Another ForceType question


  • Please log in to reply
2 replies to this topic

#1 dereke55

dereke55
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 01 May 2006 - 02:31 PM

I've read post after post about configuring apache and php to create "clean" urls and I'm having some problems.

Here's my setup:
Apache/2.0.55
PHP/5.1.2
Server running on port 8080

What I want to do:
I want the url: localhost:8080/news/1 to point to script: news.php with 1 as the parameter instead of: news.php?id=1

What works now:
[a href=\"http://localhost:8080/news.php?id=1\" target=\"_blank\"]http://localhost:8080/news.php?id=1[/a]

Problem:
[a href=\"http://localhost:8080/news/1\" target=\"_blank\"]http://localhost:8080/news/1[/a] returns back
"The requested URL /news/1 was not found on this server."

The only changes I made to the httpd.conf are below:

The below changes were added to the very end of the file
# For PHP 5 do something like this:
LoadModule php5_module "c:/php/php5apache2.dll"
AddType application/x-httpd-php .php

# Configure the path to php.ini
PHPIniDir "C:/php"

# Remove extension
<Files news>
   ForceType application/x-httpd-php
</Files> 

I added the AcceptPathInfo to line 241 of the file
<Directory />
    Options FollowSymLinks
    AllowOverride All
    AcceptPathInfo On
</Directory>

I would prefer to use the ForceType method instead of the mod_rewrite method for performance reasons. So if anyone has any suggestions, please let me know.

Thanks

#2 monkey_magix

monkey_magix
  • New Members
  • Pip
  • Newbie
  • 7 posts

Posted 09 March 2007 - 07:25 AM

Did you manage to get this working? i'm facing the same problem

#3 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 09 March 2007 - 06:31 PM

Look in to mod_rewrite. This is what people use to make clean user friendly URL's. Check out this site  for getting started with mod_rewrite.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users