Forum Moderators: phranque
RewriteCond %{QUERY_STRING} ^(.+)$
RewriteRule /Display\.html$ http://example.com/Ticket/DisplayTicket.html%1 [R=301,L]
RewriteRule ^/index\.html$ http://example.com/RTindex.html/ [R=301,L]
This worked out when a user simply typed http://example.com/ in his browser and it avoided the pop-up but soon we realized that emails that were sent to users to access our application also gave a URL:
http://example.com/Ticket/Display.html?id=4935.
When a user clicks on the link given in the mails it gives a pop-up which we want to avoid and so the reason for using the other redirect:
RewriteRule /Display\.html$ http://example.com/Ticket/DisplayTicket.html%1 [R=301,L]
So i wanted to redirect the URL http://example.com/Ticket/Display.html?id=4935 so that i can avoid the pop-up.
Thanks
Nathan
RewriteCond %{QUERY_STRING} .+
RewriteRule ^Ticket/Display\.html$ http://example.com/Ticket/DisplayTicket.html [R=301,L]
RewriteCond %{QUERY_STRING} .+
RewriteRule ^Ticket/Display\.html$ /Ticket/DisplayTicket.html [L]
For more information, see the documents cited in our forum charter [webmasterworld.com] and the tutorials in the Apache forum section of the WebmasterWorld library [webmasterworld.com].
Jim
I am not at all sure whether you are trying to publish static URLs and server them with dynamic content, or vice-versa...
Jim
I want to redirect the above example URLS to the following URLS.The html file(DisplayTicket.html) is present in the location /usr/local/rt/local/html/Ticket/. Again the value of id is dynamic.
http://example.com/Ticket/DisplayTicket.html?id=4935
http://example.com/Ticket/DisplayTicket.html?id=4938
http://example.com/Ticket/DisplayTicket.html?id=123
******************************************************
2. The URLs which are given in the browser which need to be redirected are:
http://example.com/
[test.example.com...]
[test_help.example.com...]
The location of the index file(index.html) is present in the location: /usr/local/rt/local/html/.
The URLS in point(2) need to be redirected to:
http://example.com/RTindex.html. The location of this html file is present in /usr/local/rt/local/html/.
******************************************************
Thanks
Nathan
In that case, you'll need a leading slash on the RewriteRule pattern:
RewriteCond %{QUERY_STRING} id=[^&]+
RewriteRule [b]^/T[/b]icket/Display\.html$ http://example.com/Ticket/DisplayTicket.html [R=301,L]
If this doesn't work, I have no clue why... :(
Jim
RewriteCond %{HTTP_REFERER}
! ^Ticket/DisplayTicket\.html$ [NC]
RewriteRule ^/index\.html$ [webtlh01...] [R=301,L]
Basically i am trying to avoid the RTindex.html page from appearing when Ticket/DisplayTicket.html is accessed.
Thanks,
Nathan