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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T03:56:50+00:00 2026-05-30T03:56:50+00:00

How do you rewrite a url with a # in? e.g. http://www.example.com/index.php#test In my

  • 0

How do you rewrite a url with a # in? e.g. http://www.example.com/index.php#test

In my current .htaccess file I have:

RewriteEngine On    # Turn on the rewriting engine

RewriteRule  ^([^/.]+)/?$ $1.php [L] # rewrite without query string parameters
RewriteRule  ^([^/.]+)/([^/.]+)/?$ $1.php\#$2 [L] # one name string parameter

This would rewrite a url such as http://www.example.com/index/test so you are directed to the page, but not take you to the relevant tag like http://www.example.com/index#test or http://www.example.com/index.php#test would.

  • 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-30T03:56:52+00:00Added an answer on May 30, 2026 at 3:56 am

    I use something like this to redirect an url to another with a hash at the end:

    RewriteRule ^([^/.]+)/([^/.]+)$ $1.php#$2 [R=301,L,NE]
    

    Note: The # (and anything after it) is not part of the actual HTTP request to the server.
    So you can’t refer to it or get the hash value in you .htaccess.

    The hash is never sent to the server, so you can’t match it with
    mod_rewrite!

    You have to use e.g. Javascript to acces values after the hash!

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

Sidebar

Related Questions

Current versions of MediaWiki have the front page accessible via http://www.example.com/wiki/index.php/Main_Page Instead of the
Is it possible to re-write (Apache Mod-Rewrite) a URL from this: http://www.example.com/view.php?t=h5k6 to this
I'm trying to rewrite a url of this: http://www.foo.com/bar/baz to index.php?q=$1&d=baz Where bar is
I know how to make URL's rewrite, for example: www.example.com/index.php?id=1&cat=3 to www.example.com/1/3/ (or whatever).
I have a rewrite in my htaccess file that removes index.php from the url
I need to rewrite URL like http://www.example.com/search.php?abc to http://www.example.com/abc using the rules below, but
I've got a url type:- http://www.example.com/products.php?cat=1 which I am able to rewrite to:- http://www.example.com/myproduct1
My URL structure is like http://www.example.com/folder/index.php?dir=dir1 To be able to access it from http://www.example.com/folder/dir1
For my website i want to rewrite my url to: www.xxx.com/en/index.php instead of www.xxx.com/index.php?language=en
I'm trying to do the following: I have the url: http://www.example.com/9999 and I want

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.