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

  • Home
  • SEARCH
  • 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 6911445
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:57:23+00:00 2026-05-27T08:57:23+00:00

Possible Duplicate: Rewrite all queries to not need the .php extension using a mod_rewrite

  • 0

Possible Duplicate:
Rewrite all queries to not need the .php extension using a mod_rewrite RewriteRule

I am learning how to create a website, and would like some help.

I have this path in the wamp folder: C:\wamp\www\Personal_site\Root_fold\index.php (the main file starts here).

I want to have cleanurls for this file: C:\wamp\www\Personal_site\Root_fold\Tutorials\C_sharp\C_loginapp.php, and I want it to show up as C:\wamp\www\Personal_site\Root_fold\Tutorials\C_sharp\C_loginapp – the same file, but without the .php on the end.

I also want this to happen to every other file that I have in my website – even the index.php – without repeating the rewritecond for each and every file. How do I do that?

By the way, I am running this locally on my computer – no hosting service or anything like that – and also I am creating the .htaccess file by opening it in notepad and saving the file with the name “.htacess”, which means it forces the file to save with the .htacess extension.

  • 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-27T08:57:24+00:00Added an answer on May 27, 2026 at 8:57 am

    Clean URLs go beyond just hiding the .php extension. It also needs to incorporate query parameters, so that instead of /article?title=foobar it looks like /article/foobar.

    This problem was solved over and over and over again. Please don’t participate in the PHP community’s pervasive Not invented here syndrome and use one of the existing solutions available. It will make you a better programmer in general, because today’s programming is about artfully combining existing components with your unique domain logic instead of writing everything from scratch.

    UPDATE

    Since you are just starting, it might be hard for you to start using a full-blown framework like Symfony2 — but I suggest to use it when you’ll be more comfortable with PHP.

    For now, the Silex micro-framework might be a good start for you. It’s very easy to start with. As a simple example, here is your index.php file:

    require_once __DIR__.'/silex.phar'; 
    
    $app = new Silex\Application(); 
    
    $app->get('/hello/{name}', function($name) use($app) { 
        return 'Hello '.$app->escape($name); 
    }); 
    
    $app->run(); 
    

    And this is your .htaccess:

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

    This is a complete app written in Silex. When you go to <yourhost>/hello/JackyBoi it will respond with Hello JackyBoi.

    You can do more advanced stuff with Silex — details are in the docs. When you outgrow it, you can naturally graduate to its bigger brother Symfony2.

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

Sidebar

Related Questions

Possible Duplicate: Css and javascript Not Loading in rewrite rule After using only rewrite
Possible Duplicate: Passing varible types though mod-rewrite howdy, I'm using the get method on
Possible Duplicate: Codeigniter HVMC modular seperation extension URL rewrite / routing I am new
Possible Duplicate: How to rewrite URL without refresh, like GitHub.com Hi all, I have
Possible Duplicate: Please URL Rewrite in php I would like visitors to access the
Possible Duplicate: mod_rewrite - how to rewrite an URL? Hi can anyone of you
Possible Duplicate: .htaccess RewriteRule for Flat Links i have a problem in a rewrite
Possible Duplicate: Remove .php extension with .htaccess I'm trying to hide the .php file
Possible Duplicate: Why not use tables for layout in HTML? Under what conditions should
Possible Duplicate: .NET - What’s the best way to implement a catch all exceptions

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.