Please help me how can I redirect Url with the .htaccess file
Old Url: mydomain.com/?
GID=0FFB340425F74356BEAB3817BD8E70F9&AKH=111&desc=%D9%86%D8%B4%D8%B1
New Url: mydomain.com/test
Should be something like
RewriteCond %{QUERY_STRING} GID=0FFB340425F74356BEAB3817BD8E70F9
RewriteCond %{QUERY_STRING} AKH=111
RewriteCond %{QUERY_STRING} desc=%D9%86%D8%B4%D8%B1
RewriteRule (.*) /test? [R=301,L]
Related
we want to relaunch our website and need to 301 redirect some pages. Can somebody help me with redirect them from a subpage with parameters to a subpage withour parameters?
from:
www.example.com/pagee874.html?al=kontakt&Publikation=Die%20besten%20Ideen%20f%C3%BCr%20eine%20starke%20Pers%C3%B6nlichkeit
to
www.example.com//publikationen/
I could solve it with:
RewriteCond %{QUERY_STRING} ^al=kontakt&Publikation=Ich%20sehe%20was,%20was%20du%20nicht%20siehst$ [NC]
RewriteCond %{REQUEST_URI} ^/pagee874.html/?$
RewriteRule .* /publikationen/? [L,R=301]
Could you please try following, in case you want to check if query string is not empty.
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/pagee874\.html [NC]
RewriteCond %{QUERY_STRING} !^$
RewriteRule ^.*$ /publikationen/? [R=301,NC,L]
I'm trying this to redirect via .htaccess a this URL
http://www.deguate.com/foros/showthread.php?874-Soy-de-Guatemala-y-quiero-dar-a-mi-bebe-en-adopcion
to this one:
https://www.deguate.com/artman/publish/mujer-actualidad/Soy-de-Guatemala-quiero-dar-mi-bebe-adopcion.shtml
I've tried many options but nothing seems to work, like:
RewriteCond %{HTTP_HOST} ^.*$
RewriteRule ^foros\/showthread\.php\?874\-Soy\-de\-Guatemala\-y\-quiero\-dar\-a\-mi\-bebe\-en\-adopcion$ "https\:\/\/www\.deguate\.com\/artman\/publish\/mujer\-actualidad\/Soy\-de\-Guatemala\-quiero\-dar\-mi\-bebe\-adopcion\.shtml" [R=301,L]
You can use the following rule:
RewriteEngine on
RewriteCond %{QUERY_STRING} ^(874-Soy-de-Guatemala-y-quiero-dar-a-mi-bebe-en-adopcion)$
RewriteRule ^foros/showthread\.php$ https://www.deguate.com/artman/publish/mujer-actualidad/%1? [L,R]
I am trying to redirect old url to new url but it is not redirecting.
Old url: http://domain.com/STACK/App/
New url: http://domain.com/stack-app
And my .htaccess file
Redirect 301 /STACK/App http://domain.com/stack-app
Thanks,
Try this code.
RewriteEngine on
RewriteRule http://domain.com/STACK/App/ /http://domain.com/stack-app [R=301,L]
For more help go to this link:--
http://edward-designer.com/web/htaccess-url-rewrite-simplified/
You can use this rule as your very first redirect rule in your root .htaccess:
RedirectMatch 301 ^/STACK/App/?$ /stack-app
Within the mod_rewrite section of your .htaccess file, add the following lines on the old site:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.domain\.com\STACK\App\$
RewriteRule (.*)$ http://domain.com/stack-app/$1 [R=301,L]
</IfModule>
you can use the following code to redirect your website using .htaccess
RewriteEngine On
RewriteCond %{HTTP_HOST} !oldexample.com$ [NC]
RewriteRule ^(.*)$ http://www.newexample.com/$1 [L,R=301]
for non www version, you can use the following,
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !oldexample.com$ [NC]
RewriteRule ^(.*)$ http://newexample.com/$1 [L,R=301]
How to redirect this url with .htaccess
http://www.example.com/products.php?IDZ=0-0-0-106-1&start=156
to
http://www.example.com/
301 permanent redirection
RewriteCond %{REQUEST_URI} ^/products\.php$
RewriteCond %{QUERY_STRING} ^IDZ=(.*)$ [OR]
RewriteCond %{QUERY_STRING} ^IDZ=(.*)&start=(.*)$
RewriteRule ^(.*)$ http://www.example.com/? [R=302,L]
I solved the issue this may be helpful for other people
ive this rules at htaccess
RewriteEngine On
RewriteCond %{HTTP_HOST} ^site.com [NC]
RewriteRule ^(.*)$ http://www.site.com/$1 [L,R=301]
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^warcraft$ www.site.com/forumdisplay.php?f=480 [R=301,NE,NC,L]
issue happend when redirect warcraft its redirect to
http://www.site.com/home/site/public_html/www.site.com/forumdisplay.php?f=480
any tip ?
I suppose you want to redirect it to http://www.site.com/forumdisplay.php?f=480
If so put it in your .htaccess file:
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^warcraft$ http://www.site.com/forumdisplay.php?f=480 [R=301,NE,NC,L]
You must provide the full URL including protocol in your rule, in this case http://www.site.com/.....