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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T09:32:52+00:00 2026-05-31T09:32:52+00:00

i am building a web site using PHP and TWIG, i have organized my

  • 0

i am building a web site using PHP and TWIG, i have organized my code into:
class folder: for php classes
lib folder: for non-classes php files
templates folder: for twig templates
and index.php file

when i want to include a link for register page for example the link will be: domain-name/lib/register.php
the question is: is there any good way of hiding the file organization from the link
for example to make the link something like: domain-name/register without changing my file organization and preserving the ability to send get parameters in the url?

thanks

  • 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-31T09:32:53+00:00Added an answer on May 31, 2026 at 9:32 am

    Here’s an example htaccess file I would use. Folder structures entered after “register/” are treated as variables that forward to register.php. The QSA flag will allow you to have additional GET variables treated as vars if need be. (e.g. /register/something/?some_var=1).

    This is for specific cases when you know how many variables you want to rewrite for what pages. In other words, the below will only work with two variables/spots (e.g. /registers/var1/var2/).

    Hope that helps!

    ############################################
    ## ENABLE REWRITES
    RewriteEngine on
    Options +FollowSymLinks
    
    ## EXAMPLE WITH 1 VAR
    RewriteRule ^register/([A-Za-z0-9-]+)/ lib/register.php?var1=$1 [L,QSA]
    
    ## EXAMPLE WITH 2 VAR
    RewriteRule ^register/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/ lib/register.php?var1=$1&var2=$2 [L,QSA]
    
    ## ALSO GOOD TO HAVE ERROR DOCS REWRITE
    ErrorDocument 404 oops/
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am a newbie with zend. On the web-site i am building using zend/php,
I have been using PHP and JavaScript for building my dad's website. He wants
I am building a web site in C# using asp.NET MVC How can I
I'm building some functional tests for a web site using Selenium, and I'm stuck
I am currently building a web site and I just implemented SqlCacheDependency using LinqToSQL
I'm part of a team building an ADO.NET based web-site. We sometimes have several
Building a website using a PHP based Ecommerce product Magento. The problem I have
I am building a website using php+mysql. I have a registration page and its
I am building a web site in PHP that integrates with Youtube. I want
I'm now building a recommender system(a web site). I want to use the PHP

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.