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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T12:58:40+00:00 2026-06-16T12:58:40+00:00

I am using MVC framework in my website.In my webpage URL file extension is

  • 0

I am using MVC framework in my website.In my webpage URL file extension is not showing.I need to specify the file extension like

www.legacy.com/women/tops.php 

but its showing only

www.legacy.com/women/tops/ 

for seo purpose I want to change the url with extension. But I can’t change the folder or file name.

One more doubt I have that.My webpage is showing

www.legacy.com/women/tops/ 

like this I want to change this as http://www.legacy.com/women_tops.php/
Is it possible?

Thank you

Here is the code I use to associate a URL with a controller:

$arrCommands = array (
    'home' => "contents",
    'members' => "",        
);

if ( $arrCommands[$command1] == "*" )
{
    $includeFile = CONTROLLER_PATH . "/" . $command1 . "/" . $command2 . ".php";

    if ( !file_exists($includeFile) )
        $includeFile = CONTROLLER_PATH . "/" . $command1 . "/default.php";
}
    elseif ( !array_key_exists($command1, $arrCommands) )
    {
        $includeFile    =   CONTROLLER_PATH . "/contents/" . $command1 . ".php";
        if ( !file_exists($includeFile))
    Header( "Location: http://metroplots.ragedev/404_error/" );     
    }
else
{
    $includeFile = CONTROLLER_PATH . "/". $arrCommands[$command1] . "/" . $command1 . ".php";

    if ( !file_exists($includeFile) )
        $includeFile = CONTROLLER_PATH . "/contents/home.php";
}

include_once($includeFile);
  • 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-16T12:58:42+00:00Added an answer on June 16, 2026 at 12:58 pm

    the technology your looking for is called url rewriting

    the idea is taking a give url and rewriting it on the server side. lots of software use this method to not expose logic via get parameters…

    e.g.
    http://domain.com/blog/2

    according to the server, this url is actually:

    http://domain.com/index.php?cat=blog&page=2

    on linux/apache servers is is achieved via modrewrite:
    http://httpd.apache.org/docs/current/mod/mod_rewrite.html

    using .htaccess files on the server that explain the rewrite rules and route urls.

    microsoft iis servers have their own flavor (and syntax) called url rewrite:
    http://www.iis.net/downloads/microsoft/url-rewrite

    there are some tools out there to do this for you (here’s an overview of 6 of them)
    http://webm.ag/2009/12/15/6-of-the-best-mod-rewrite-generators/

    but i feel like most times your best best is to manually create your own.

    here’s an example of the one i use on my site:

    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . index.php [L]
    

    basically this ruleset will redirect all traffic to index.php

    in my MVC i have a generic controller called “url_logic” that runs first and looks at what the url is. and based upon it’s logic it creates the necessary controllers to create the site (even if it’s a 404 error controller).

    hope that helps get you started!

    also, if your using windows .htaccess files are tough to work with. i suggest naming them
    htaccess.txt and when you upload them to the server rename them there.

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

Sidebar

Related Questions

I'm creating a website using MVC framework (Yii) and I need to dynamically create
I am developing a website using Asp.Net MVC framework. We need to add general
I am designing a web application using the ASP.net MVC framework. I would like
I'm about to do a PHP website using the MVC pattern. I am not
I have a asp.net web application using MVC framework, the website allows the registrars
I am working with an MVC 4 ASP.NET website using Entity Framework. This is
I have an existing website developped using ASP.NET MVC 3 and Entity Framework 4
I am building a website using ASP.NET MVC and entity framework. I have a
I'm about to begin building a website using the ASP.NET MVC framework and I'm
I am using Java Script MVC framework for building a Web Application.. Now i

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.