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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T11:01:38+00:00 2026-06-01T11:01:38+00:00

I have searched for this but nobody have the same issue.. Now I need

  • 0

I have searched for this but nobody have the same issue..

Now I need an code to transform the ugly url (thats what i have) to the nice url:

  • Ugly url: domain.com/aanmelden?referral=admin
  • Nice url: domain.com/aanmelden/admin

Ik have tried soo many codes, but no one did work for me. ):

suggestions?
Thnx!

(My current htaccess: )

ErrorDocument 401 /errordocs/401.php
ErrorDocument 403 /errordocs/403.php
ErrorDocument 404 /errordocs/404.php
ErrorDocument 500 /errordocs/500.php

RewriteEngine On
RewriteBase /

RewriteCond %{HTTP_HOST} !^domain.nl$ [NC]
RewriteRule ^(.*)$ http://domain.nl/$1 [L,R=301]

RewriteCond %{REQUEST_URI} !/$ 
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]

RewriteCond %{THE_REQUEST} ^[A-Z]+\s.+\.php\sHTTP/.+
RewriteRule ^(.+)\.php $1 [R=301,L]

Where and what i need to place?

EDIT:

To be clear:

  • If the user goes to the Nice Url, they wil stay on the nice one.
  • If the user goes to the Ugly Url, they wil redirect to the Nice url.
  • 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-01T11:01:39+00:00Added an answer on June 1, 2026 at 11:01 am

    This is a trivial rewrite:

    If admin can be any lowercase string, use the pattern ([a-z]+)$ to capture one or more lowercase letters after the / and before the end of the request URI.

    RewriteEngine On
    RewriteRule ^aanmelden/([a-z]+)$ aanmelden?referral=$1 [L]
    

    If admin is really only admin, you can hard-code it as

    RewriteEngine On
    RewriteRule ^aanmelden/admin aanmelden?referral=admin [L]
    

    Update

    In context of your existing rewrites just posted, you’ll need to add this rule before the rule that adds .php since that would also match this pattern.

    # Do this before the rule that adds .php
    # Also added condition so this doesn't apply to real files...
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^aanmelden/([a-z]+)$ aanmelden?referral=$1 [L]
    
    RewriteCond %{REQUEST_URI} !/$ 
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^([^\.]+)$ $1.php [NC,L]
    

    Update 2

    If you want the end user to get the ugly URL and rewrite it to the nice one, use:

    RewriteCond %{REQUEST_QUERYSTRING} referral=([a-z]+)
    RewriteRule ^aanmelden aanmelden/%1 [L]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have searched but can't find why this simple code will fail in Drools
I have searched this, but I could'n find or understand what I found. Now
I have searched and searched for this but I think my terminology isn't correct
So I have searched for this but not finding anything about it and if
I have searched for a general solution to this but only find answers to
Preface: I am sure this is incredibly simple, but I have searched this site
First of all I have searched many times in this forum but none is
I have searched but could not find the reason for this behavior. I have
I have searched through many times but have not seen this before. Probably really
I realize this is a basic question but I have searched online, been to

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.