• Hi guys,

    The question is – what could be the best soltuion to do this:

    My wp site is site.com with permalinks enabled (/%category%/%postname%/). So the links site.com/category1/post1 and site.com/category/category1 work.

    But I would like to have a variable as the first segment of the URI. E.g. if anyone access the page throught links like:
    site.com/randomvar/category/category1/ or site.com/randomvar/category1/post1 or site.com/randomvar/, the same pages as without the randomvar are shown (and the variable is carried afterwards to all links)

    I guess that could be done with htacces partly, but wordpress itself will output all the links without the variable, right?
    I looked into add_rewrite_tag, but that only works on posts (not pages/categories/index …).

    I would be very appreciated for any help or hint where should I look into (even if it’s core file changing). Thanks in advance!

  • The topic ‘First uri segment as a variable’ is closed to new replies.