Forum Moderators: phranque

Message Too Old, No Replies

htaccess redirect problem for URL with special character

htaccess redirect problem for URL with special character

         

Dss_dev

2:55 pm on Jan 3, 2009 (gmt 0)

10+ Year Member



Hello,

In one of our site, we have an URL like:

http://www.example.com/index.php?read=abc.html

and we want to permanently redirect to the URL

http://www.example.com/abc.php

How to do that?

Thanks
Deb

[edited by: jdMorgan at 7:13 pm (utc) on Jan. 3, 2009]
[edit reason] example.com [/edit]

jdMorgan

7:15 pm on Jan 3, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This search [google.com] for previous threads on this subject should help you to get started.

Links to several useful resources are available in our Forum Charter, and several tutorials and useful threads are included in our Apache Forum Library (see links at top of page).

You mention a "special character" in your thread description, but I see no special characters in your example URL. If this issue is important, please post more details on this "special character."

Thanks,
Jim

wildbest

8:11 pm on Jan 3, 2009 (gmt 0)

10+ Year Member



MOD_ALIAS redirects should do the job. Put the following in your htaccess file:

Redirect 301 /index.php?read=abc.html http://www.example.com/abc.php

g1smd

10:07 pm on Jan 3, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You will need to use Mod_Rewrite here, with a RewriteCond to examine %{QUERY_STRING} or %{THE_REQUEST}