Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7173561
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T15:51:00+00:00 2026-05-28T15:51:00+00:00

I set the wordpress permalink-structure to just use the articlename and got a .htaccess

  • 0

I set the wordpress permalink-structure to just use the articlename and got a .htaccess that looks like this

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

works fine.

but I want to distinguish between different locations (i.e. berlin, hamburg or muenchen) in my various template files. so I thought I’d add the location to the URL like this:

http://myurl.com/berlin/articlename

and now I need to rewrite this to

http://myurl.com/articlename?location=berlin

but

http://myurl.com/articlename

or

http://myurl.com/category/articlename

should still work. just look for predefined locations (berlin|hamburg|muenchen).

how do I need to adjust the RewriteRule above to accomplish this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T15:51:01+00:00Added an answer on May 28, 2026 at 3:51 pm

    i fixed this with the following additions to the .htaccess file:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    
    RewriteCond %{QUERY_STRING} !location
    RewriteRule ^(muenchen|berlin)/$ /index.php?location=$1 [NC,QSA,P]
    
    RewriteCond %{QUERY_STRING} !location
    RewriteRule ^(muenchen|berlin)/(.*)$ /$2?location=$1 [NC,QSA,P]
    
    RewriteRule ^index\.php$ - [L]
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    
    </IfModule>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I set my wordpress permalink structure to /%postname%/ but now when I go to
WordPress has this thing that examines whether it has been set up (installed) on
I am trying to set up a page on a wordpress site that displays
I've set up a WordPress navigation for my single.php template that gets the previous
This website annapogossova.com is set up through wordpress. As you can see each gallery
I have a Wordpress site that I am currently working on and have set
I've been able to set up proper permalink redirections in Wordpress by entering /%category%/%postname%/
I have a wordpress site with like buttons that are generated for each post
I have a set of code that modifies the native wordpress gallery: /* Open
I have a wordpress site that is set to 970px wide and i built

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.