Wordpress Rewriterule php in page

4 replies
Hello to everyone.
I want to change my links from
site .com/league/?c=england
to
site .com/league/england

site .com/league/?c=england loading information from site .com/folder/leaguestat.php

I try this code in .htaccess
Code:
RewriteRule ^league/(.*)$ folder/leaguestat.php?c=$1 [L]
and he works but wodpress lose template

P.S. Im new and sorry if this is wrong section
#page #php #rewriterule #wordpress
  • Profile picture of the author Harrison_Uhl
    Not sure about adding your own rewrite rules to htaccess, it looks like what you want might be addressable through the 'Perma Links' functions on the admin control panel. (Perhaps you have the htaccess part right, but Wordpress doesn't know what to do afterwards without the Perma Links setup.)

    Harrison
    {{ DiscussionBoard.errors[4413373].message }}
  • Profile picture of the author professorrosado
    "change category permalink" search in the wordpress add plugin menu
    and choose a plug in. Usually, this is the first thing you need to do to find wordpress solution for your issues.
    {{ DiscussionBoard.errors[4413384].message }}
    • Profile picture of the author Sentenello
      Originally Posted by professorrosado View Post

      "change category permalink" search in the wordpress add plugin menu
      and choose a plug in. Usually, this is the first thing you need to do to find wordpress solution for your issues.
      In wordpress settings of Permalinks im on Custom structure - /%postname%/

      P.S. PHP Execution is name of my plugin to read php code in Posts and Pages
      {{ DiscussionBoard.errors[4413553].message }}
  • Profile picture of the author Sentenello
    UP
    I cant undestand why when i make code with id all works perfect but with symbols doesnt

    With
    Code:
    RewriteRule ^league/([0-9]+)$ folder/leaguestat/?c=$1 [L]
    Wordpress doesnt lose template and show right information.
    {{ DiscussionBoard.errors[4418569].message }}

Trending Topics