Problems with url rewrite of query string?

You can do this by removing the query string entirely: RewriteCond %{QUERY_STRING} ^p=(0-9*)$ RewriteRule ^. *$ /#blog/%1? NE,R This should give you: url.com/#blog/213" rel="nofollow">url.com/#blog/213 If you want to check if the URL contains the term "blog" then simply check: RewriteCond %{REQUEST_URI} .

*/blog It is important to note that you will not be able to check for "blog" in links like url.com/#blog because, as noted by Patrick, everything after the is not sent to the server See the Apache wiki on mod_rewrite for more information.

You can do this by removing the query string entirely: RewriteCond %{QUERY_STRING} ^p=(0-9*)$ RewriteRule ^. *$ /#blog/%1? NE,R This should give you: url.com/#blog/213" rel="nofollow">url.com/#blog/213 If you want to check if the URL contains the term "blog" then simply check: RewriteCond %{REQUEST_URI} .

*/blog/. * It is important to note that you will not be able to check for "blog" in links like url.com/#blog because, as noted by Patrick, everything after the # is not sent to the server. See the Apache wiki on mod_rewrite for more information.

I need url. Com/#blog/213 not url.Com/#blog/p=213. – blcArmadillo Apr 28 at 22:01 @blcArmadillo -- sorry, that was a typo -- the rewrite rule I gave you should give you url.

Com/#blog/213. – Sean Vieira Apr 28 at 22:05 I too would think that this would work however for some reason it still puts p= in the rewritten url... odd. Any ideas?

– blcArmadillo Apr 28 at 22:40 Aha I just realized that the %0 in the RewriteRule should be changed to %1. – blcArmadillo Apr 28 at 22:42 Smacks head -- Should have realized that. I have updated my answer as well -- thanks!

– Sean Vieira Apr 28 at 22:45.

That may not work because browsers do not send the fragment of the url after the hash (#) with the request, so any request for url.com/#blog/p=213?p=213" rel="nofollow">url.com/#blog/p=213?p=213 will be a request for url.com/ The hash fragment is supposed to be used for anchor tags on pages, and is never sent to the server.

The request the user is sending is url. Com/blog/? P=123.

But with the current rewrite rules I have in place the request url is being rewritten to url. Com/#blog/p=213? P=213 when I want it to be rewritten to url.Com/#blog/213.

– blcArmadillo Apr 28 at 21:15 Don't use the hash in the rewrite rule for the above reasons. To get it working without the hash, use something like this: RewriteRule ^/blog/(0-9+)$ blog/$1 R=301 – Patrick Apr 28 at 22:10.

Try this rule in your . Htaccess file: Options +FollowSymlinks -MultiViews RewriteEngine on RewriteCond %{QUERY_STRING} ^p=(.*)$ NC RewriteRule ^blog/? $ /#blog/%1?

NC,NE,L,R With above a URL of http://localhost/blog/? P=1234 will become localhost/#blog/1234.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions