search engine friendly URLs problem..help

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
definewebsites
Forum Newbie
Posts: 19
Joined: Thu May 01, 2008 9:51 pm

search engine friendly URLs problem..help

Post by definewebsites »

Hi there,

I am trying to implement search engine friendly URLs on my website. I have a .htaccess file in the root of my server with the following rewrite rule,

Code: Select all

 
Options +FollowSymLinks
RewriteEngine on
RewriteRule portfolio/page/(.*)/ portfolio.php?page=$1
RewriteRule portfolio/page/(.*) portfolio.php?page=$1   
 
However, when I try to call my dynamic pages like mydomain/portfolio.php/page/2 , I get an error saying "No input file specified."

Am I missing something?

On my portfolio.php page, I have an if condition as below:

Code: Select all

 
if(isset($_GET['page']))
{
  $pageNum = $_GET['page'];
}
 
I would appreciate some assistance, thanks...
User avatar
Kastor
Forum Newbie
Posts: 24
Joined: Thu May 01, 2008 2:29 am
Location: Grodno, Belarus
Contact:

Re: search engine friendly URLs problem..help

Post by Kastor »

Try this :wink:

Code: Select all

<?php
$_QYERY1 = parse_url($_SERVER['REQUEST_URI']);
if (!empty($_QYERY1['query'])){
    $_QYERY2 = array();
    parse_str($_QYERY1['query'], $_QYERY2);
    $_GET = array_merge($_GET, $_QYERY2);
}
?>
definewebsites
Forum Newbie
Posts: 19
Joined: Thu May 01, 2008 9:51 pm

Re: search engine friendly URLs problem..help

Post by definewebsites »

Hi, Thanks for the response.

I tried that but I still got the error "no input file specified"..

:(
User avatar
Kastor
Forum Newbie
Posts: 24
Joined: Thu May 01, 2008 2:29 am
Location: Grodno, Belarus
Contact:

Re: search engine friendly URLs problem..help

Post by Kastor »

However, when I try to call my dynamic pages like mydomain/portfolio.php/page/2 , I get an error saying "No input file specified."
Why portfolio.php? Try mydomain/portfolio/page/2/

Please write full error text
definewebsites
Forum Newbie
Posts: 19
Joined: Thu May 01, 2008 9:51 pm

Re: search engine friendly URLs problem..help

Post by definewebsites »

Hi,

I did attempt calling my page like http://mydomain.com/portfolio/page/2 but I still received the error message which simply said "no input file specified".

Thanks
Post Reply