thestars Posted March 9, 2010 Share Posted March 9, 2010 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. Quote Link to comment https://forums.phpfreaks.com/topic/194596-rewriterule-in-htaccess-for-a-url-containing-the-character/ Share on other sites More sharing options...
dreamwest Posted March 17, 2010 Share Posted March 17, 2010 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/ Quote Link to comment https://forums.phpfreaks.com/topic/194596-rewriterule-in-htaccess-for-a-url-containing-the-character/#findComment-1027479 Share on other sites More sharing options...
thestars Posted March 25, 2010 Author Share Posted March 25, 2010 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 Quote Link to comment https://forums.phpfreaks.com/topic/194596-rewriterule-in-htaccess-for-a-url-containing-the-character/#findComment-1031560 Share on other sites More sharing options...
cags Posted March 25, 2010 Share Posted March 25, 2010 Try this... RewriteRule ^test.html$ /#id [R,NE] Quote Link to comment https://forums.phpfreaks.com/topic/194596-rewriterule-in-htaccess-for-a-url-containing-the-character/#findComment-1031593 Share on other sites More sharing options...
thestars Posted March 29, 2010 Author Share Posted March 29, 2010 Sorry, This is not working. Showing "page not found" error instead of redirecting Quote Link to comment https://forums.phpfreaks.com/topic/194596-rewriterule-in-htaccess-for-a-url-containing-the-character/#findComment-1033411 Share on other sites More sharing options...
cags Posted March 29, 2010 Share Posted March 29, 2010 What is the full URL you are requesting and what is the full URL you wish to actually see? Quote Link to comment https://forums.phpfreaks.com/topic/194596-rewriterule-in-htaccess-for-a-url-containing-the-character/#findComment-1033414 Share on other sites More sharing options...
thestars Posted April 2, 2010 Author Share Posted April 2, 2010 http://www.example.com/#holistic Quote Link to comment https://forums.phpfreaks.com/topic/194596-rewriterule-in-htaccess-for-a-url-containing-the-character/#findComment-1035735 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.