w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories

301 redirect with ? (question mark) not working in htacces


You can't match against the query string in a Redirect statement, use mod_rewrite and match against the %{QUERY_STRING} var:

RewriteEngine On
RewriteCond %{QUERY_STRING}
^AddID=1078&Rand=666171759380936096$
RewriteRule ^order/order.html$
http://www.domain.nl/? [L,R=301]

But since you have like 8000 URLs that start with the query string ?AddID=, then you can just match against that:

RewriteEngine On
RewriteCond %{QUERY_STRING} ^AddID=[0-9]
RewriteRule ^order/order.html$
http://www.domain.nl/? [L,R=301]

Categories : Htaccess

Related to : 301 redirect with ? (question mark) not working in htacces
Redirect 301 htacces with question mark 404 file not found
Not so much used to Redirect, but with RewriteRule, you could go like this : RewriteEngine on RewriteCond %{QUERY_STRING} ^nav=3&id=106$ RewriteRule ^fr/verhuur_details.asp$ /fr/location/knikarm? [R=301,L] This should work. Note : if you want keep query string after redirect, you'll need to delete ? at the end : RewriteEngine on RewriteCond %{QUERY_STRING} ^nav=3&id=106$ RewriteRule

Categories : PHP
Removing question mark ? from subfolder URL in htacces wp
How about something like this: RewriteEngine On RewriteCond %{THE_REQUEST} ^[A-Z]{3,9} /(.+)?( |$) RewriteRule ^(.*)$ /$1? [L,R=301] You'd put those rules in the htaccess file in your document root.

Categories : Htaccess
URL redirect not working for contains question mark "?" in the url in magento
dot (.) is not the really good character to put in a url parameters and it is most probably that that makes things go wrong. you can probably use underscore (_) or some other thing. If you really need to use a dot, you should have a look to : http://stackoverflow.com/a/16999694/2660794

Categories : Magento
how to redirect. old url to new url. [Laravel, htacces]
You could make a route that catches all routes that are not in your routes.php. It has to be in the bottom of your routes.php file. Here you can check if id exists and if the uri contains main.php. Route::get('{uri}', function($uri) { $id = Input::get('id'); if(preg_match('/main.php/i', $uri) && isset($id)){ return Redirect::to('http://www.example.com/n/'.$id); }else

Categories : PHP
.htacces redirect when $1 is empty
Tweak your regex to support 0 or more characters instead of 1 or more characters. Try this rule: Options +FollowSymlinks RewriteEngine On RewriteRule ^shop/([^/.]*)/?$ /shop.php?url=$1 [L]

Categories : PHP
© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.