Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.