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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:37:17+00:00 2026-05-27T22:37:17+00:00

i need to rewrite rules in my installation of easyphp on windows 7. i

  • 0

i need to rewrite rules in my installation of easyphp on windows 7.

i need to make sure the rules are loaded correctly and i don’t have to create tons of rules. also, when i copy the .htaccess to my server (which is linux) i want to make sure its working properly.

i have no experience with this and here’s what i found diging the internet:

RewriteRule (.*) index.php?s=$1

now, if i have basic page like ‘contact-us’ its ok but if i have sub pages it does not. how can i create sub folders?

thank you

  • 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-27T22:37:18+00:00Added an answer on May 27, 2026 at 10:37 pm

    Here’s what you need to do:

    RewriteEngine On
    RewriteBase /
    RewriteRule ^([a-z0-9_\-]+)/?$ index.php?main=$1 [NC,L] 
    RewriteRule ^([a-z0-9_\-]+)/([a-z0-9_\-]+)/?$ index.php?main=$1&sub=$2 [NC,L]
    

    This will allow you to have pages like:

    http://www.domain.com/mainpage/ or
    http://www.domain.com/mainpage or
    http://www.domain.com/mainpage/subpage/ or
    http://www.domain.com/mainpage/subpage
    

    /? Means the slash is optional

    [NC] This makes the test case-insensitive – differences between ‘A-Z’ and ‘a-z’ are ignored, both in the expanded TestString and the CondPattern. This flag is effective only for comparisons between TestString and CondPattern. It has no effect on filesystem and subrequest checks.

    [L] The [L] flag causes mod_rewrite to stop processing the rule set. In most contexts, this means that if the rule matches, no further rules will be processed.

    All the information about flags and rules: http://httpd.apache.org/docs/current/mod/mod_rewrite.html

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

Sidebar

Related Questions

I have all my rewrite rules setup and working in .htaccess but I need
I have 8 lines of rewrite rules in my .htaccess file. I need to
i need some help from the experts. I have some rewrite rules: post.php go
i need some help to write two URL rewrite rules in IIS7, i have
I have the following rewrite rule that I need to alter in order to
I need rewrite this url http://adresa.com/article.php?act=view&id=1113 to http://adresa.com/view/1113 I make it with mod_rewrite in
I need to rewrite some Python code into PHP (don't hate me, a customer
I have the following URLS which I need to rewrite: product.php?iata=TV&product=12345 to product/Televison/TV/Sony-Bravia/12345 and
I'm trying to setup some rewrite rules for a new Umbraco website we have.
I have two rewrite rules: RewriteRule ^([^/]+)(/.+)? /negocio$2.php?shopURL=$1 [L,QSA] and RewriteRule ^([^/]+)(/.+)? /negocio/?shopURL=$1 [L,QSA]

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.