Jump to content

.htaccess help with php .modrewriterule


roshanjonah

Recommended Posts

Hi

 

I am having problem with php files....

 

My .htaccess file looks like this:

 

RewriteEngine on

 

RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond %{REQUEST_FILENAME}\.php -f

RewriteRule ^(.*)$ $1.php

 

RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond %{REQUEST_FILENAME}\.html -f

RewriteRule ^(.*)$ $1.html

 

RewriteBase /

 

RewriteRule ^website/([0-9]*)/(.*).html$ website.php?id=$1

RewriteRule ^viewall/([0-9]*).html$ index.php?page=$1

RewriteRule ^view/([0-9]*)/(.*)/([0-9]*).html$ cat.php?i=$1&page=$3

RewriteRule ^upcoming/([0-9]*)/(.*)/([0-9]*).html$ upcoming.php?i=$1&page=$3

RewriteRule ^users/([0-9]*)/(.*)/([0-9]*).html$ profile.php?id=$1&page=$3

 

My php file looks like this

 

$page->SetParameter ('CAT_URL', $config['site_url'].'view/'.$story['story_cat'].'/'.modrewriteurl($cats[$story['story_cat']]['cat_title']).'/1.html');

 

$page->SetParameter ('PROFILE_LINK', $config['site_url'].'users/'.$story['user_id'].'/'.$story['user_name'].'/1.html');

 

$page->SetParameter ('EMAIL_URL', $config['site_url'].'website/'.$story['story_id'].'/'.modrewriteurl($story['story_title']).'.html');

 

I just want to make the url of these to be just like the site_url/view/category

 

1. site_url/view/category_title

 

2. site_url/users/username

 

3. site_url/website/website_title

 

Can you please tell me how to edit these things to make it into the desired url mentioned above.

 

Thank You - your help would be very much appreciated.

 

Link to comment
https://forums.phpfreaks.com/topic/139473-htaccess-help-with-php-modrewriterule/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.