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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T14:59:14+00:00 2026-06-04T14:59:14+00:00

I have links like these: www.domain.com/page.php?id=1#info I’d just like to hide the .php to

  • 0

I have links like these:

www.domain.com/page.php?id=1#info

I’d just like to hide the .php to get this:

www.domain.com/page?id=1#info

For this reason I found this .htaccess script:

RewriteEngine on

# to make `/path/index.php` to /path/
RewriteCond %{THE_REQUEST} ^GET\s(.*/)index\.php [NC]
RewriteRule . %1 [NE,R=301,L]

RewriteCond %{THE_REQUEST} ^GET\s.+\.php [NC]
RewriteRule ^(.+)\.php$ /$1 [NE,R=301,L,NC]

RewriteCond %{REQUEST_URI} !\.php$ [NC]
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule . %{REQUEST_URI}.php [L]

This does exactly the job and works in all browser except safari, which will output:

www.domain.com/page?id=1

The #info is gone.

How could a browser interpret a .htaccess different? Can someone help me to write the correct .htaccess file?

  • 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-04T14:59:15+00:00Added an answer on June 4, 2026 at 2:59 pm

    Safari behaves the way every browser should:

    Fragments depend on the document MIME type and are evaluated by the
    client
    (Web browser). Clients are not supposed to send URI-fragments
    to servers when they retrieve a document, and without help from a
    local application (see below) fragments do not participate in HTTP
    redirections.

    Wikipedia: Fragment identifier

    In plain English: the part of the URL after the # shouldn’t be sent to the server by the browser. The browser should handle this locally. This means that you might loose the fragment when you apply redirects (rewrite rules).

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

Sidebar

Related Questions

I have links like these that I want to change: mypage.com?page=missions&id=5 mypage.com?page=hello I tried
If there are a number of links to my web site like this: www.domain.com/?linkid=101
I have updated my website. Previously there were links like these: http://example.com/bla-bla-bla?language=de . After
I have links like this: <li><a href=# data-value=Codes>Get codes</a></li> <li><a href=# data-value=Product>Get products</a></li> How
I have an iframe tab which holds php page with various links inside (like
I have magento installed in a subdirectory. www.domain.com/subdir/magento This site worked perfectly at one
I have a website which contains links like so: http://www.example.com/about http://www.example.com/about-computing http://www.example.com/about-web I'm designing
I have a domain. Let's call it www.example.com for this question. Thanks to the
I have a URL that resides on another domain, like this: http://ads.adserver.com/ad?site=1233&zone=45435 When you
At my webpage I have links to images like this: img/123456765/mypicture.jpg (<img src=img/123456765/mypicture.jpg />)

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.