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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T04:28:57+00:00 2026-05-30T04:28:57+00:00

I’m getting ready to develop a web site with the following url structure. I’m

  • 0

I’m getting ready to develop a web site with the following url structure.

I’m a newbie to url rewrites and would like to know the best way to handle this.

http://domain.com                    index.php
http://domain.com/about              about.php
http://domain.com/agencies           agencies.php
http://domain.com/contact            contact.php
http://domain.com/publisher          publisher.php
http://domain.com/publisher/sign_up  publisher_signup.php
http://domain.com/agencies/sign_up   agencies_signup.php
http://domain.com/agencies/login     login.php
http://domain.com/advertiser         advertiser.php
http://domain.com/advertiser/sign_up advertiser_signup.php
http://domain.com/advertiser/login   login.php

What would be the most efficient htaccess rewriterule?

Should I just manually enter each line with a rewrite or is there some good search/replace I could use?

I’m thinking long term the number of slashes in the url could be the most 4
for example

 http://domain.com/area/sub_area/sub_area2/sub_area3

Any help would be greatly appreciated.

  • 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-30T04:28:59+00:00Added an answer on May 30, 2026 at 4:28 am

    I’m sorry but your “URL” transformation are not homogeneous (= it’s not possible to “generalize” because they do not share exactly the same principles) so here’s the best I could do:

    RewriteEngine On
    ^/?$ index.php [NC,QSA,L]
    ^/?about$ about.php [NC,QSA,L]
    ^/?(agencies|contact|publisher|advertiser)$ /$1.php [NC,QSA,L]
    ^/?(publisher|agencies|advertiser)/sign_up$  /$1_signup.php [NC,QSA,L]
    ^/?(publisher|agencies|advertiser)/login$    /login.php [NC,QSA,L]
    

    But if you want “homogeneous” stuff that do not perfectly fit with what you’re asking, you may have “cleaner” rules like this:

    RewriteEngine On
    ^/?$ index.php [NC,QSA,L]
    ^/?about$ about.php [NC,QSA,L]
    ^/?(agencies|contact|publisher|advertiser)$ /$1.php [NC,QSA,L]
    ^/?(agencies|contact|publisher|advertiser)/sign_up$ /$1_signup.php [NC,QSA,L]
    ^/?(agencies|contact|publisher|advertiser)/login$ /login.php [NC,QSA,L]
    

    And if you really want to centralize everything, you could do (= pass the type to the php file):

    RewriteEngine On
    ^/?$ index.php [NC,QSA,L]
    ^/?about$ about.php [NC,QSA,L]
    ^/?(agencies|contact|publisher|advertiser)$ /$1.php [NC,QSA,L]
    ^/?(agencies|contact|publisher|advertiser)/(sign_up|login)$ /$2.php?type=$1 [NC,QSA,L]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to count the length of a string with PHP. The string
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
I've got a string that has curly quotes in it. I'd like to replace
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have a French site that I want to parse, but am running into
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this

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.