开发者

Can I use a hashmark in .htaccess URL?

开发者 https://www.devze.com 2023-04-06 07:24 出处:网络
I\'m using jquery address and everything is working great except for one small is开发者_如何学运维sue inside my .htaccess file.I\'d like to redirect one of my urls that includes a hashmark to another

I'm using jquery address and everything is working great except for one small is开发者_如何学运维sue inside my .htaccess file. I'd like to redirect one of my urls that includes a hashmark to another URL.

Here is my current setup using redirect (that works):

Options +FollowSymLinks
RewriteEngine on
RewriteRule view_profile=(.*)$ view_profile.php?id=$1 

If a user logs in at any point this URL doesn't work because my jquery address looks like this:

http://localhost/#view_profile=5

If I add the leading hash as part of my rewriterule it breaks. Does anyone know if it's possible to use a leading hashmark as part of the URL?


No you can't do this, as anything after the # is a fragment identifier and therefore not sent to the server.

See the RFC on URIs here: https://www.rfc-editor.org/rfc/rfc3986#section-3.5

0

精彩评论

暂无评论...
验证码 换一张
取 消