Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: htaccess redirect with RewriteCond |
|
Author |
|
fi ku
Joined: 31 Mar 2016 Posts: 3 Location: World
|
Posted: Thu 31 Mar '16 13:57 Post subject: htaccess redirect with RewriteCond |
|
|
I've this redirect to organize:
Code: | oldpage: http:// example.com/folder/public.php?service=files&t=7a406ad94e3e5b4f6ed247c6a279570a |
Code: | newpage: http:// example.com/folder/public.php?service=files&t=1cb5f1a52ccebfebdb218ecbdb70f9e4 |
A the beginning I tryed with normal Redirect command in htaccess but I understood its not working because there is some value after .php in the url string, so I found this code using the ReWriteCond:
Code: | RewriteEngine On
RewriteCond %{HTTP_HOST} ^example.com$ [NC]
RewriteCond %{QUERY_STRING} ^service=files&t=7a406ad94e6e5b4f6ed246c6a279570a(&.*)?$ [NC]
RewriteRule ^folder/public\.php$ http:// example.com/folder/public.php?service=files&t=1cb5f1a52ccebfebdb218ecbdb70f9e4 [R=301,NE,NC,L] |
But also is not working (whith the oldpage I recived a 404)... What is wrong?
Thanks in advance |
|
Back to top |
|
fi ku
Joined: 31 Mar 2016 Posts: 3 Location: World
|
Posted: Sun 03 Apr '16 11:14 Post subject: |
|
|
^ up
no one know how to fix? |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
|
Back to top |
|
fi ku
Joined: 31 Mar 2016 Posts: 3 Location: World
|
Posted: Mon 04 Apr '16 15:16 Post subject: |
|
|
Yes I need help, following your guide I tryed also with:
Code: |
RewriteCond %{QUERY_STRING} ^service=files&t=7a406ad94e6e5b4f6ed246c6a279570a$
RewriteRule (.*) http:// example.com/folder/public.php?service=files&t=1cb5f1a52ccebfebdb218ecbdb70f9e4 [R=301,L]
|
But also is not working at all |
|
Back to top |
|
|
|
|
|
|