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 8130601
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T08:46:24+00:00 2026-06-06T08:46:24+00:00

I’m currently getting to grips with mod_rewrite and have ran into a stumbling block

  • 0

I’m currently getting to grips with mod_rewrite and have ran into a stumbling block which i was hoping someone would be kind enough to help

I have a site that is structured as so

https://www.abc.com/region1/
https://www.abc.com/region2/
https://www.abc.com/region3/

Within each of these folders lies two files i’ll call example1.php and example2.php, both are dynamic

Regarding example1.php a possibility might be example1.php?var1=1
Regarding example2.php one possibility might be example2.php?var1=1&var2=1

I’ve been trying to use the following but its throwing a server 500 error

RewriteEngine On
RewriteRule ^example1alias/ example1alias/([^/\.]+)/?$ example1.php?var1=$1 [L]
RewriteRule ^example1alias/ example1alias/?$ example1.php [L]
RewriteRule ^example2alias/ example2alias/([^/\.]+)/([^/\.]+)/?$ example2.php?var1=$1&var2=$2 [L]

My .htaccess containing this code is located in the subfolder itself and if i understand mod_rewrite correctly the ^ tells the rule to run from the active path

Could someone point out what i’m doing incorrectly

As always any advise is greatly appreciated

Regards
Barry

  • 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-06-06T08:46:29+00:00Added an answer on June 6, 2026 at 8:46 am

    Most of the times HTTP 500 (for htaccess) are for syntax errors in the htaccess file.

    For rewrite rules I believe the syntax is: RewriteRule Pattern Substitution [flags]
    (http://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewriterule)

    You seem to have more than one patterns for one rule, maybe you can try separating them out into 2 different rules.

    • RewriteRule ^example2alias/ example2.php [L]
    • RewriteRule ^example2alias/([^/.]+)/([^/.]+)/?$ example2.php?var1=$1&var2=$2 [L,QSA]

    Also add “RewriteEngine On” and “Options FollowSymLinks” to your htaccess file

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I would like to run a str_replace or preg_replace which looks for certain words
I have a French site that I want to parse, but am running into
I have a text area in my form which accepts all possible characters from
I am currently running into a problem where an element is coming back from
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I have just tried to save a simple *.rtf file with some websites and

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.