user725013
user725013

Reputation: 31

Rewritten URL should contain #. How can I resolve this?

Actually I want to rewrite URL through .htaccess.

My actual URL is

front/property/uploadphotos_pid.php?pid=11#NO 

I want to convert this to

uploadphotos_pid/11/NO.php

and have written following code:

RewriteRule ^uploadphotos_pid/([a-zA-Z0-9\-]+)/([a-zA-Z0-9\-]+).php$ 
front/property/uploadphotos_pid.php?pid=$1&#=$2

Upvotes: 0

Views: 45

Answers (2)

Quentin
Quentin

Reputation: 943563

The fragment identifier (the section of a URI starting with #) is handled entirely client side. It is not sent to the server. The server (which is where mod_rewrite runs) therefore cannot do anything with it.

Upvotes: 4

pintxo
pintxo

Reputation: 2155

# must be escaped as %23 in a URL

Upvotes: 0

Related Questions