Forum Moderators: phranque
I want this http://www.example.com/guestbook/screen.php?vgbxiferp=&vgbreliam=55 to http://www.example.com/guestbook/screen.php
Here is the code I have so far:
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{QUERY_STRING} vgbxiferp=&vgbreliam
RewriteRule ^screen\.php$ http://www.example.com/guestbook/screen.php [R=301,L]
Welcome to WebmasterWorld!
Let's back up a minute. What do you expect this RewriteRule to do?
From your code, you expect that if you type the URL http://www.example.com/guestbook/screen.php?vgbxiferp=&vgbreliam
into your browser, you want it to execute the file http://www.example.com/guestbook/screen.php.
Is that correct?
Jim
2. My host told me that by putting the RewriteEngine on would turn it on. I have a open ticket with them right now about it?
3. How do I adjusting the RewriteRule pattern from one directory to the main directory?
RewriteCond %{QUERY_STRING} vgbxiferp=&vgbreliam
RewriteRule ^[b]guestbook/[/b]screen\.php$ http://www.example.com/guestbook/screen.ph[b]p?[/b] [R=301,L]
Jim
- When I click on the link, it is brings up a blank page both in Firefox and IE.
I don't know what else to do. Everything should be working. I have my .htaccess CH mode on 744. Is that the right permission?
1) Did you flush your browser cache(s) (Temporary Internet Files) before testing?
2) You are now calling screen.php with a blank query string. What do you expect screen.php to do in this case?
3) What do you get if you directly enter http://www.example.com/guestbook/screen.php in the browser address bar - a blank page, or something else?
Jim
- yes I did, and it still don't do it
- it suppose to email that user who wrote that message
- blank screen
Here is the web address: <snip>. If you go to someone's email address on this guestbook, it brings up a blank screen. All I want is to get rid of all the junk pass screen.php.
[edited by: jdMorgan at 2:25 am (utc) on April 11, 2006]
[edit reason] No URLS, please. See Terms of Service. [/edit]
The function of mod_rewrite is not to make pretty URLs. And your script apparently requires the information that we finally succeeded in removing, with the result that it broke the script.
If the query string parameters are required by the script, then you cannot remove them and expect it to work.
I'm sorry, but I don't know where to go from here. If it were my site, I'd leave it alone.
For more information about mod_rewrite applications, see the tutorials in the Apache forum section of the WebmasterWorld library [webmasterworld.com].
Jim