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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T20:27:22+00:00 2026-06-05T20:27:22+00:00

I am using .htaccess code in order to pass pages titles to the url

  • 0

I am using .htaccess code in order to pass pages titles to the url and then retrieve them with php from mysql tables when the page loads.

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l

RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]

I am using this php code to explode the url and get the title:

$passed_url = $_SERVER['REQUEST_URI'];
$passed_url = explode("/", $passed_url);
$passed_url = end($passed_url);

Now I want to create a user profile page like so www.website.com/users/User_name_in_here
how do I check with php if this is a users page or it is just a regular page which can be writer like so: www.webiste.com/Page_title_in_here
is there a better way to do this ?(I am just a starter in 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-06-05T20:27:23+00:00Added an answer on June 5, 2026 at 8:27 pm

    One way is to check $passed_url[1]. If it’s ‘users’ then you know you’re on the users page.

    A better way would be to use index.php as a front controller and pass the request to a controller based on the request uri. there are a number of ways to do this.

    Some frameworks map the uri to a class::method. So your url would be changed to /users/view/username and the users::view would be called.

    I prefer to write regular expressions and which ever regular expression is matched controls which controller is loaded.

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

Sidebar

Related Questions

Using .htaccess all addresses are rewritten to index.php Index.php needs to then work out
Possible Duplicate: How to add .php extension using .htaccess url rewriting? I want to
I blocked an IP using htaccess: order allow,deny deny from dynamicip-176-212-139-222.pppoe.barnaul.ertelecom.ru allow from all
How can i add .php at the end of url using .htaccess and below
hello i'm using this .htaccess code to redirect urls. RewriteEngine on RewriteRule ^printer/([^/\.]+)/?$ printer.php?id=$1
I'm using htaccess to change a file extension from gif to php but it
I want to pass a url through a link My htaccess code is :
I'm using the following lines of code in my .htaccess file to create redirects.
I want to redirect using .htaccess abc.com/test.php to abc.com/test . but it will execute/display
At the moment using .htaccess in my PHP Application to choose which page I'm

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.