Jump to content

RewriteRule in htaccess for a URL containing the character "#"


thestars

Recommended Posts

Hi,

 

I have a problem with URL  RewriteRule with my .htaccess file. ie. I need to redirect to a Url containing the special character "#" (Example:www.example.com/#id) from an html page. When "#" is given direcltly , it is redirected to

www.example.com/%23id and resulting "a page not found" error page.

The rewrite rule I used is

Options +FollowSymLinks

RewriteRule ^test.html$ /#test/ [R=301,L]

Please anyone help. Thanks in advance.

Hi,

 

I have a problem with URL  RewriteRule with my .htaccess file. ie. I need to redirect to a Url containing the special character "#" (Example:www.example.com/#id) from an html page. When "#" is given direcltly , it is redirected to

www.example.com/%23id and resulting "a page not found" error page.

The rewrite rule I used is

Options +FollowSymLinks

RewriteRule ^test.html$ /#test/ [R=301,L]

Please anyone help. Thanks in advance.

 

Your "real" url wont exist anywhere. So you saying you have a directory like this?

 

http://site.com/#test/

  • 2 weeks later...

Hi,

 

The url is the home page of my site and #id is the id of a <div> tag  in my home page. ie I need to redirect to a specific section in my home page. My site is built in wordpress. Its home page url is http://www.example.com/.

So Whenever http://www.example.com/test.html comes, it needs to be redirected to http://www.example.com/#id.ie to the <div id="id"> section of my home page.

 

Thanks

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.