Forum Moderators: phranque
[edited by: phranque at 11:00 pm (utc) on Nov 14, 2013]
[edit reason] Please Use example.com [webmasterworld.com] [/edit]
RewriteEngine On
RewriteCond %{QUERY_STRING} !=""
RewriteRule ^(.*)$ /$1? [R=301,L]
RewriteCond %{QUERY_STRING} !=""
RewriteRule ^(.*)$ /$1? [R=301,L]
RewriteCond %{QUERY_STRING} . RewriteRule ^ubytovanie-typ/hotel/ et cetera Parameters is the prodigy of former redirection.
RewriteRule .? http://www.example.com%{REQUEST_URI}? [R=301,L]
My Wordpress stopped working after that.
RewriteCond %{QUERY_STRING} ^typ=hot$
RewriteRule ^ubytovanie.php$ http://example.com/ubytovanie-typ/hotel/ [R=301,L] http://example.com/ubytovanie-typ/hotel/?typ=hot [edited by: phranque at 10:23 pm (utc) on Nov 16, 2013]
[edit reason] exemplified domain [/edit]
I want to remove the part ?typ=hot from the target URL.
RewriteRule ^ubytovanie.php$ /ubytovanie-typ/hotel/? [R=301,L] you typically want to include the fully qualified protocol and hostname in the RewriteRule Target with a redirect unless you have a good reason not to.
RewriteRule ^ubytovanie.php$ /ubytovanie-typ/hotel/? [R=301,L]
you typically want to include the fully qualified protocol and hostname in the RewriteRule Target with a redirect unless you have a good reason not to
----
but if you ever move [or for some reason your host changes a setting], you could be in for a "head-scratcher" about why your site broke
If an absolute URL is specified, mod_rewrite checks to see whether the hostname matches the current host. If it does, the scheme and hostname are stripped out and the resulting path is treated as a URL-path.
(/\S+ \[R=30[12].+) http://www.example.com$1 What problems can arise?