• I had a page with mostly php scripts.

    For example with the url /sverige/elitserien/serietabell/2016/ i gets with help of he .htaccess file, Nation, League and Year.

    But becasue that i also had to set the permlink in WP to the sameto retsch the page i made. I can’t change for example year.

    what i need to do is to set the permlink to something like /*/*/serietabell/*/

    Hard to explain in English, but please ask and i try to explain again.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter jonassturebrand

    (@jonassturebrand)

    I have a page…. should it of course be.

    Moderator bcworkz

    (@bcworkz)

    WP rewrite rules and many .htaccess rules support regular expressions (regexp), so doing what you’re after is possible. The most generic regexp that allows anything between slashes (except slashes of course) is /[^/]*/

    However, the permlink format in WP Settings does NOT support regexp, at least not directly. You can however use rewrite tags, their definition DOES support regexp. There’s probably no reason to use custom rewrite tags, there’s a number of predefined tags available.

    Regexps are very powerful. but not intuitive. I’ve found any one of the several regexp “fiddle” sites to be very helpful in composing a good regexp. Just one example is https://www.regexr.com/

    Thread Starter jonassturebrand

    (@jonassturebrand)

    Sorry if i missunderstand you.

    But to get the rewrite rule to work what should i set the permalink to?

    For example the page i have, that page get automatic a permlink. in this case. “serietabell”

    But i want to use the url

    https://www.wp.aktuellspeedway.se/sverige/elitserien/serietabell/2016/

    and then i can’t find the page becasue obvious wordpress want me to use https://www.wp.aktuellspeedway.se/serietabell/

    Te rewrite rule i use is
    RewriteRule ^([a-zA-Z0-9\-]+)/([a-zA-Z0-9\-]+)/serietabell/([a-zA-Z0-9\-]+)/$ ?nation=$1&league=$2&season=$3

    Thread Starter jonassturebrand

    (@jonassturebrand)

    Now i’m very Close to do what i want, but still have one problem. The url redirects to the permalink i have in wordpress and thats is not what should happend.

    Is that because of some parameters in WP?

    Thread Starter jonassturebrand

    (@jonassturebrand)

    Again one step further.

    What i have now is

    RewriteRule ^([a-zA-Z0-9\-]+)/([a-zA-Z0-9\-]+)/serietabell/([a-zA-Z0-9\-]+)/$ ?page_id=10&nation=$1&league=$2&season=$3 [R,L]

    I Want to use for example > sverige/elitserien/serietabell/2016/ <

    When i type this in the url now change to serietabell/?nation=sverige&league=elitserien&season=2016

    serietabell/ is the permalink for the page in WP. But i want the url to still be > sverige/elitserien/serietabell/2016/ < and not being changed.

    Thread Starter jonassturebrand

    (@jonassturebrand)

    No one?

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Permlinks with wildcards?’ is closed to new replies.