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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T15:05:43+00:00 2026-05-20T15:05:43+00:00

I have the urls like http://localhost/mis http://localhost/mis/newsletter.php http://localhost/mis/cms.php?mainid=65 http://localhost/mis/news.php?mainid=93 Well I am using these

  • 0

I have the urls like

http://localhost/mis  
http://localhost/mis/newsletter.php  
http://localhost/mis/cms.php?mainid=65  
http://localhost/mis/news.php?mainid=93

Well I am using these urls for school section.

Now for the A-level section I have the following urls

http://localhost/mis/index.php?mode=0  
http://localhost/mis/newsletter.php?mode=0  
http://localhost/mis/cms.php?mainid=65&mode=0  
http://localhost/mis/news.php?mainid=93&mode=0

I want the above urls to be routed like

http://localhost/mis/a-level  
http://localhost/mis/a-level/newsletter.php  
http://localhost/mis/a-level/cms.php?mainid=65  
http://localhost/mis/a-level/news.php?mainid=93

Please help me out with these url routing via .htaccess file.

EDIT: The htaccess file is under mis folder

FILE STRUCTURE:

root>>
    mis>>
        .htaccess
        newsletter.php
        cms.php
        news.php
  • 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-20T15:05:44+00:00Added an answer on May 20, 2026 at 3:05 pm

    Try these in the .htaccess file inside the /mis folder.

    # turning rewrite on
    RewriteEngine On
    
    # this will redirect: mis/a-level
    RewriteRule ^a-level$ index.php?mode=0 [L]
    
    # this will redirect all the rest
    RewriteRule ^a-level/(.+)$ $1?mode=0 [QSA,L]
    

    I think the lines like http://localhost/mis/cms.php?mainid=65&mode=0 are just copy-paste errors and you ment: http://localhost/mis/cms.php?mainid=65&mode=0

    I have tested these rules. If they don’t work on your system there must be some configuration issue. Are there other rewrite rules in your file? I not, try enabling rewrite logging to get some more information. This must be enabled in httpd.conf (they are not allowed in .htaccess).

    RewriteLog D:\bence\wamp\logs\rewrite.log
    RewriteLogLevel 3
    

    My rewrite log for the url http://proba.test/mis/a-level/news.php?some=thing&other=33

    127.0.0.1 - - [11/Mar/2011:11:36:03 +0100] [proba.test/sid#713440][rid#f67a88/initial] (3) [perdir D:/bence/www/proba.test/mis/] add path info postfix: D:/bence/www/proba.test/mis/a-level -> D:/bence/www/proba.test/mis/a-level/news.php
    127.0.0.1 - - [11/Mar/2011:11:36:03 +0100] [proba.test/sid#713440][rid#f67a88/initial] (3) [perdir D:/bence/www/proba.test/mis/] strip per-dir prefix: D:/bence/www/proba.test/mis/a-level/news.php -> a-level/news.php
    127.0.0.1 - - [11/Mar/2011:11:36:03 +0100] [proba.test/sid#713440][rid#f67a88/initial] (3) [perdir D:/bence/www/proba.test/mis/] applying pattern '^a-level$' to uri 'a-level/news.php'
    127.0.0.1 - - [11/Mar/2011:11:36:03 +0100] [proba.test/sid#713440][rid#f67a88/initial] (3) [perdir D:/bence/www/proba.test/mis/] add path info postfix: D:/bence/www/proba.test/mis/a-level -> D:/bence/www/proba.test/mis/a-level/news.php
    127.0.0.1 - - [11/Mar/2011:11:36:03 +0100] [proba.test/sid#713440][rid#f67a88/initial] (3) [perdir D:/bence/www/proba.test/mis/] strip per-dir prefix: D:/bence/www/proba.test/mis/a-level/news.php -> a-level/news.php
    127.0.0.1 - - [11/Mar/2011:11:36:03 +0100] [proba.test/sid#713440][rid#f67a88/initial] (3) [perdir D:/bence/www/proba.test/mis/] applying pattern '^a-level/(.+)$' to uri 'a-level/news.php'
    127.0.0.1 - - [11/Mar/2011:11:36:03 +0100] [proba.test/sid#713440][rid#f67a88/initial] (2) [perdir D:/bence/www/proba.test/mis/] rewrite 'a-level/news.php' -> 'news.php?mode=0'
    127.0.0.1 - - [11/Mar/2011:11:36:03 +0100] [proba.test/sid#713440][rid#f67a88/initial] (3) split uri=news.php?mode=0 -> uri=news.php, args=mode=0&some=thing&other=33
    127.0.0.1 - - [11/Mar/2011:11:36:03 +0100] [proba.test/sid#713440][rid#f67a88/initial] (3) [perdir D:/bence/www/proba.test/mis/] add per-dir prefix: news.php -> D:/bence/www/proba.test/mis/news.php
    127.0.0.1 - - [11/Mar/2011:11:36:03 +0100] [proba.test/sid#713440][rid#f67a88/initial] (2) [perdir D:/bence/www/proba.test/mis/] strip document_root prefix: D:/bence/www/proba.test/mis/news.php -> /mis/news.php
    127.0.0.1 - - [11/Mar/2011:11:36:03 +0100] [proba.test/sid#713440][rid#f67a88/initial] (1) [perdir D:/bence/www/proba.test/mis/] internal redirect with /mis/news.php [INTERNAL REDIRECT]
    127.0.0.1 - - [11/Mar/2011:11:36:03 +0100] [proba.test/sid#713440][rid#253ab08/initial/redir#1] (3) [perdir D:/bence/www/proba.test/mis/] strip per-dir prefix: D:/bence/www/proba.test/mis/news.php -> news.php
    127.0.0.1 - - [11/Mar/2011:11:36:03 +0100] [proba.test/sid#713440][rid#253ab08/initial/redir#1] (3) [perdir D:/bence/www/proba.test/mis/] applying pattern '^a-level$' to uri 'news.php'
    127.0.0.1 - - [11/Mar/2011:11:36:03 +0100] [proba.test/sid#713440][rid#253ab08/initial/redir#1] (3) [perdir D:/bence/www/proba.test/mis/] strip per-dir prefix: D:/bence/www/proba.test/mis/news.php -> news.php
    127.0.0.1 - - [11/Mar/2011:11:36:03 +0100] [proba.test/sid#713440][rid#253ab08/initial/redir#1] (3) [perdir D:/bence/www/proba.test/mis/] applying pattern '^a-level/(.+)$' to uri 'news.php'
    127.0.0.1 - - [11/Mar/2011:11:36:03 +0100] [proba.test/sid#713440][rid#253ab08/initial/redir#1] (1) [perdir D:/bence/www/proba.test/mis/] pass through D:/bence/www/proba.test/mis/news.php
    

    And the log for: http://proba.test/mis/a-level

    127.0.0.1 - - [11/Mar/2011:11:39:29 +0100] [proba.test/sid#713440][rid#25f6338/initial] (3) [perdir D:/bence/www/proba.test/mis/] strip per-dir prefix: D:/bence/www/proba.test/mis/a-level -> a-level
    127.0.0.1 - - [11/Mar/2011:11:39:29 +0100] [proba.test/sid#713440][rid#25f6338/initial] (3) [perdir D:/bence/www/proba.test/mis/] applying pattern '^a-level$' to uri 'a-level'
    127.0.0.1 - - [11/Mar/2011:11:39:29 +0100] [proba.test/sid#713440][rid#25f6338/initial] (2) [perdir D:/bence/www/proba.test/mis/] rewrite 'a-level' -> 'index.php?mode=0'
    127.0.0.1 - - [11/Mar/2011:11:39:29 +0100] [proba.test/sid#713440][rid#25f6338/initial] (3) split uri=index.php?mode=0 -> uri=index.php, args=mode=0
    127.0.0.1 - - [11/Mar/2011:11:39:29 +0100] [proba.test/sid#713440][rid#25f6338/initial] (3) [perdir D:/bence/www/proba.test/mis/] add per-dir prefix: index.php -> D:/bence/www/proba.test/mis/index.php
    127.0.0.1 - - [11/Mar/2011:11:39:29 +0100] [proba.test/sid#713440][rid#25f6338/initial] (2) [perdir D:/bence/www/proba.test/mis/] strip document_root prefix: D:/bence/www/proba.test/mis/index.php -> /mis/index.php
    127.0.0.1 - - [11/Mar/2011:11:39:29 +0100] [proba.test/sid#713440][rid#25f6338/initial] (1) [perdir D:/bence/www/proba.test/mis/] internal redirect with /mis/index.php [INTERNAL REDIRECT]
    127.0.0.1 - - [11/Mar/2011:11:39:29 +0100] [proba.test/sid#713440][rid#260c1d0/initial/redir#1] (3) [perdir D:/bence/www/proba.test/mis/] strip per-dir prefix: D:/bence/www/proba.test/mis/index.php -> index.php
    127.0.0.1 - - [11/Mar/2011:11:39:29 +0100] [proba.test/sid#713440][rid#260c1d0/initial/redir#1] (3) [perdir D:/bence/www/proba.test/mis/] applying pattern '^a-level$' to uri 'index.php'
    127.0.0.1 - - [11/Mar/2011:11:39:29 +0100] [proba.test/sid#713440][rid#260c1d0/initial/redir#1] (3) [perdir D:/bence/www/proba.test/mis/] strip per-dir prefix: D:/bence/www/proba.test/mis/index.php -> index.php
    127.0.0.1 - - [11/Mar/2011:11:39:29 +0100] [proba.test/sid#713440][rid#260c1d0/initial/redir#1] (3) [perdir D:/bence/www/proba.test/mis/] applying pattern '^a-level/(.+)$' to uri 'index.php'
    127.0.0.1 - - [11/Mar/2011:11:39:29 +0100] [proba.test/sid#713440][rid#260c1d0/initial/redir#1] (1) [perdir D:/bence/www/proba.test/mis/] pass through D:/bence/www/proba.test/mis/index.php
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wanna get url path by javascript, for example, i have these urls: http://localhost:8080/blah/blah/index.php?p=1
I am using urls like this parameters http://localhost/articles/?author=Ben%20Cooper%2CAlex%20Hunter&title=.....&tags=.. I urlencode them in the links.
The Zend project creates URLs like: http://localhost/zftest/public/index/add How can I have a URL like
Possible Duplicate: Path.Combine for Urls? I have a root directory like http://localhost/ I have
It's easier to be told by example. I have URLs like http://domain/product/view/id/ . How
I want to have my site urls look like http://example.com/place/info?var=info&morevars=ifneeded Place and info are
So I'd like to have urls on my site like http://foobar.com/hadees that goes to
I have some URLs, like http://www.example.com/something?param1=value1&param2=value2&param3=value3 and I would like to extract the parameters
[NOTE: I'm using ASP.NET MVC2 RC2.] I have URLs like this: /customers/123/orders/456/items/index /customers/123/orders/456/items/789/edit My
I have SEF urls like /sitename/section/12-news-title and number 12 is id of the news.

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.