Jump to content

php and htaccess problem


Davie33

Recommended Posts

Hi i have a url problem if anyone can help on this please.

This part helps the url so no need to worrie about this part.

$forumcat = intval($_GET['id']);

 

As you can see the 2nd url works great  $ctlink = $setting['siteurl'] . 'index.php?act=createtopic&cat='.$forumcat;.

But how do i set it for the first url as am working with seo yes and no and what would the htaccess rule be.

 

I have this for htaccess rule for now RewriteRule createtopic.html$ index.php?act=createtopic

 

seo yes is this $ctlink = $setting['siteurl'].'createtopic.html'; doesn't work

seo no is this $ctlink = $setting['siteurl'] . 'index.php?act=createtopic&cat='.$forumcat; which works

<?php
    if ($setting['seo'] == 'yes') {
    $ctlink = $setting['siteurl'].'createtopic.html';
    } else {
    $ctlink = $setting['siteurl'] . 'index.php?act=createtopic&cat='.$forumcat;
    }
?>
<a href="<?php echo $ctlink;?>" class="button">New Topic</a>

 

Link to comment
https://forums.phpfreaks.com/topic/268142-php-and-htaccess-problem/
Share on other sites

This is what the url would look like when seo no

http://localhost/mysite/index.php?act=createtopic&cat=4

 

How do i get it for seo yes ?.

$ctlink = $setting['siteurl'].'createtopic/'.$forumcat.'.html';

this is the url link am trying to fix.

http://localhost/mysite/createtopic/2.html

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.