LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   apache redirect (https://www.linuxquestions.org/questions/linux-newbie-8/apache-redirect-696949/)

mahmoud 01-13-2009 04:51 AM

apache redirect
 
hi can some one please help me with redirecting i have tried but still not working
i want to redirect
www.example.com/?id=1234 to
www.example.com

nidhinmd 01-13-2009 06:39 AM

Did u tried the rewrite rule. May be this link will help u.

http://httpd.apache.org/docs/2.0/misc/rewriteguide.html

mahmoud 01-13-2009 07:50 AM

yes i tried
RewriteCond %{REQUEST_URI} ^www\.example\.com$
RewriteRule ^/\?id\=(\d+) http://www.example.com/$1 [L,R=301]
didnt work and i tried

RewriteCond %{REQUEST_URI} /www.example\.com$
RewriteCond %{QUERY_STRING} ^id=[^&]+
RewriteRule http://www.example.com/$1 [L,R=301]

rajeshkerala 01-13-2009 08:59 PM

I think there is a directive in apache like this:

alias redirect www.example.com/** www.example.com


All times are GMT -5. The time now is 11:51 PM.