• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

rewriting the URL so as to not use ?foo=bar

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › rewriting the URL so as to not use ?foo=bar

This topic is: not resolved

Tagged: htaccess, rewrite

  • This topic has 4 replies, 2 voices, and was last updated 11 years, 4 months ago by abs.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • April 9, 2015 at 4:47 am #147190
    abs
    Member

    Hi Everyone
    I'm Andrew and live in Sydney, NSW, Australia. New here, I'm okay with doing WordPress stuff, but have been doing web stuff for some time, pretty much self taught.

    Am revamping my wife's business website and am using WP & Genesis but now getting to some of the grittier pages where in the past I would do http://www.example.com/blah.php?foo=bar or using a Rewrite Rule do http://www.example.com/blah-bar (changing blah-* to blah.php?foo=* )

    So, I'm now wanting to do this in WordPress. If I code blah.php?foo=bar, I get the $_REQUEST["foo"] has a value of bar, but where in WordPress can I set up the appropriate rewrite rules (or equivalent). Using the .htaccess doesnt seem to work, and I'm going around in circles searching online for answers.

    Hoping someone can point me in a properling documented answer 🙂

    Cheers

    PS I thought I created a new thread earlier, but might not have done something properly... I apologise in advance if the original is their somewhere

    April 9, 2015 at 6:17 am #147196
    Brad Dalton
    Participant

    Hi

    What URL exactly do you want to rewrite and to what?

    Try this http://www.smashingmagazine.com/2011/11/02/introduction-to-url-rewriting/

    Also, this question is not really specific to StudioPress child themes. All questions are welcome here however you might find the .htaccess tag on Stackoverflow.com a better place to ask this type of question.


    Tutorials for StudioPress Themes.

    April 9, 2015 at 6:23 am #147198
    Brad Dalton
    Participant

    http://stackoverflow.com/questions/tagged/.htaccess


    Tutorials for StudioPress Themes.

    April 9, 2015 at 7:08 am #147203
    abs
    Member

    thanks for your replies Brad... just to clarify

    change

    website/blah-bar

    to become

    website/blah.php?foo=bar

    Thus whatever comes after the blah- is passed in on the foo variable 🙂 but the URL is coded as website/blah-bar

    Off to check those links

    April 9, 2015 at 5:44 pm #147261
    abs
    Member

    If anyone can help, this is really strange

    PS Brad, I already knew how to write rules but did glean some extra info from the links - thanks, this seems more specific to using rules in WordPress

    So, my .htaccess currently reads :

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^aaaa$ /index.php [L]
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress

    with the line after the RewriteBase added by me to test. I would expect that if I go to website/aaaa to be taken back to my home page. But I just get page not found

    It's almost as if the rules arent being looked at at all (even if I take out the IfModule statements too

  • Author
    Posts
Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2026 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble