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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:17:19+00:00 2026-05-23T14:17:19+00:00

I use following .htaccess-code to convert my URLs to user-friendly ones: RewriteEngine on RewriteRule

  • 0

I use following .htaccess-code to convert my URLs to user-friendly ones:

RewriteEngine on
RewriteRule ^(.*)/$ index.php?page=$1

Now I want to redirect requests from the www-subdomain to the rootdomain, e.g. if the user requests http://www.mydomain.com/stuff/, he gets to see http://mydomain.com/stuff/ in the address bar of his browser.

All attempts I’ve made resulted in external redirects, so the user gets to see the rewritten URL, e.g. http://mydomain.com/index.php?page=stuff.

How do I perform an internal redirect, so that the address bar doesn’t change?

  • 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-23T14:17:20+00:00Added an answer on May 23, 2026 at 2:17 pm

    Use these rules (put them into .htaccess file in root folder):

    RewriteEngine On
    RewriteBase /
    
    # canonical domain name (no www please)
    RewriteCond %{HTTP_HOST} =www.domain.com
    RewriteRule ^(.*)$ http://domain.com/$1 [QSA,R=301,L]
    
    # nice url handler
    RewriteRule ^(.*)/$ /index.php?page=$1 [QSA,L]
    

    You most likely had the correct rules already (based on your description) .. you just had them in wrong order. You have to keep in mind — order matters.

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

Sidebar

Related Questions

I use the following .htaccess code to enable friendly URLs in a website. RewriteEngine
I have the following .htaccess rule: RewriteEngine on RewriteRule ^(.*) http://www.server2.com/index.php?action=$1 I need to
I currently use .htaccess and PHP to parse URLs in the following way: URL
I have the following code in ://localhost/.htaccess... AddType application/x-httpd-php5 .css .js RewriteEngine on RewriteRule
I use the following rule to redirect pretty urls from http://hostname.co.za/geoip/123.12.123.34 to http://hostname.co.za/geoip/index.py?ip=123.12.123.34 .htaccess
I have the following .htaccess RewriteRule ^register.html$ ?page=register I have a jquery ajax function
Many people recommend that you use the following code in .htaccess for GZip: AddOutputFilterByType
I have the following in my .htaccess currently- <IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^go/([^/]*)/([0-9]+)/([0-9]+)/?$
I use .htaccess Mod Rewrite to send the URL to index.php, which then parses
I have the following rewrite rule in my .htaccess file: RewriteRule ^([^/]+)/([^/]+)/(tab:([^/]+)/?)?(scope:([^/]+)/?)?(sort:([^/]+)/?)?(p:\d+)/?)?$ web/results.php?view=$1&q=$2&tab=$4&searchscope=$6&sortBy=$8&page=$10 [NC,QSA,L]

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.