Joseph  Norton

Joseph Norton

1548140044

.htaccess redirect if # exist in URI

i've been looking for this solution and i couldnt find anything.

the idea is redirect depend on URI string but the problem is htaccess can't catch #.

IF # exist in URI redirect to LINK_A

ELSE redirect to LINK_B

here my little code and its not working for me

RewriteEngine on
RewriteRule ^((?!#).)*$ http://google.fr [L,R=301,NE]
RewriteRule # http://redirect.fr [L,R=301,NE]


#regex #apache

What is GEEK

Buddha Community

Guide To WordPress Redirects (Steps To Follow)

This is image title

You will observe that many of your URLs have been changed whenever you redesign your website. This is also applicable whenever you made certain changes to its permalink structure. Ultimately, it creates a big issue for users as well as search engines.

Here, comes the role of WordPress redirects which contributes to providing a simple solution. Whenever you make use of a redirect, your visitors would not be negatively impacted. This is something that will keep your search engine rankings intact.

If you are thinking about how to do redirects in WordPress, then don’t worry as this article will provide you a detailed guide on this.

What Is A Page Redirect?

This is a set of rules which tells a browser to forward your visitors from a specific link they clicked on to a diverse page.

Whenever you redirect a page, there are mainly two outcomes for your end-users. Either, they will see a redirection message or they will be simply redirected without any notification.

This is image title

Adding redirects becomes important whenever you have redesigned your website, made certain updates to your permalinks, or changed your domain. This is necessary to make your pre-existing content accessible to search engines as well as readers.

So, it can be said, that you are forwarding your users to a completed new web page with the help of these redirects.

When You Should Focus On Redirecting A Page?

There are many reasons, for which you may wish to redirect URLs on your website. Some of the most common reasons for this include the following:

  • The URL of the page is changing.
  • A specific page that is no longer relevant.
  • Focusing to move your domain from HTTP to HTTPS.
  • You are deleting or moving your content.
  • You are changing your original domain name or making use of a different domain.

Additionally, redirects can also help you to make sure that if a page is missing or broken, then the users will be sent along with the other content of your website without any sort of interruption.

Different Types Of Redirects To Know About

There are some of how you can make use of a redirect. Not only that but there are many other types as well. Below, you will find some of the most common redirect methods which you might need to use.

(A) 301 Permanent Redirect

If you are permanently deleting or moving a page, then this redirect is generally used. It may be used when you are considering moving your website from one URL to another or you are switching to a new hosting service.

(B) 302 Temporary Redirects

This is a temporary redirect that should be used with caution as well as tested for browser compatibility. Also, this redirect tells the user that the file that you are looking for exists. But, it is not loading for some particular reason.

After that, the users are offered an alternative option. These redirects can again carry SEO penalties specifically for long-term use. So, this is a good option for temporary websites.

© 303 See Other

This is considered to be very important specifically in terms of security. Often, this is used as a replacement for the 302 redirects whenever issues arise. This type of redirect prevents users from submitting the same information more than once.

They will be redirected to a different page once they submit their information. You can also prevent refreshing or bookmarking sensitive data like credit card information. So, this prevents users from making any mistakes like accidentally purchasing the same item twice.

(D)307

This redirect is similar in functionality as well as purpose to the 303 redirects. Here, the main difference lies in the way, in which it receives and sends information.

Only, one data exchange method is used in this case. So, this can be called a true temporary redirect. But, a 303 redirect makes use of two methods.

(E)308

This is known to be a permanent redirect similar to 301 redirects. It is mainly used whenever the location of a file has changed.

The main difference existing between 308 and 301 is that the 308 can only make use of the POST method whereas a 301 can specifically change the HTTP method from POST to GET.

(F) HTTP To HTTPS Redirect

There are several advantages of an HTTPS URL over an HTTP URL both in terms of SEO and security. However, you will need to set up a redirect that forces browsers to display the HTTPS version of your pages.

[Learn more]

#how to do redirects in wordpress #wordpress 301 redirects #wordpress plugin for 301 redirects #wordpress redirects #wordpress redirects to another site #wordpress redirects to https

Seamus  Quitzon

Seamus Quitzon

1594682206

Laravel detect mobile device and redirect mobile website htaccess

In this article, i will let you know laravel detect mobile device and redirect mobile website. So let’s see how can we detect mobile device and redirect website to the mobile website.

A web application can be open on desktops, laptops, tablets and mobiles. But a large application should be optimized for all devices means if we open it on desktop, there might be heavy resources used that would be not compatible for mobile devices. So we can redirect this website to mobile website or mobile freindly website. We generally see that if we open a website on mobile device, it redirects to like http://m.domain.com.

Here, in this article we will see two seperate example to implement this. First one would be using .htaccess file and second one is using laravel route.

Example 1: Using .htaccess file

For detacting mobile device and redirect to the mobile website, we will need to create a .htaccess file on root directory of application. So create this .htaccess file and update the following lines of code.

RewriteEngine On
RewriteCond %{QUERY_STRING} !^desktop
RewriteCond %{HTTP_USER_AGENT} "android|blackberry|googlebot-mobile|iemobile|iphone|ipod|#opera mobile|palmos|webos" [NC]
RewriteCond %{HTTP_USER_AGENT} "acs|alav|alca|amoi|audi|aste|avan|benq|bird|blac|blaz|brew|cell|cldc|cmd-" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "dang|doco|eric|hipt|inno|ipaq|java|jigs|kddi|keji|leno|lg-c|lg-d|lg-g|lge-" [NC,OR]
RewriteCond %{HTTP_USER_AGENT}  "maui|maxo|midp|mits|mmef|mobi|mot-|moto|mwbp|nec-|newt|noki|opwv" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "palm|pana|pant|pdxg|phil|play|pluc|port|prox|qtek|qwap|sage|sams|sany" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "sch-|sec-|send|seri|sgh-|shar|sie-|siem|smal|smar|sony|sph-|symb|t-mo" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "teli|tim-|tosh|tsm-|upg1|upsi|vk-v|voda|w3cs|wap-|wapa|wapi" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "wapp|wapr|webc|winw|winw|xda|xda-" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "up.browser|up.link|windowssce|iemobile|mini|mmp" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "symbian|midp|wap|phone|pocket|mobile|pda|psp" [NC]
RewriteRule ^$ http://m.domain.com [L,R=302]

Example 2: Using Laravel Routes

After doing this through .htaccess, we can also detect mobile device and redirect to mobile site using laravel routes.

For doing this, we will need to create laravel routes and will need to add some lines of code to do this as written below.

function isMobile() {
    if(isset($_SERVER['HTTP_USER_AGENT'])) {
    $useragent=$_SERVER['HTTP_USER_AGENT'];
    if(preg_match('/(tablet|ipad|amazon|playbook)|(android(?!.*(mobi|opera mini)))/i', strtolower($useragent))) {
        return true ;
    } ;

    if(preg_match('/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i',$useragent)||preg_match('/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i',substr($useragent,0,4))){
            return true ;
        }
    }
    return 0 ;
}
if(isMobile()) {
    include_once(app_path().'/routes/mobile_routes.php');
} else {
    require_once(app_path().'/routes/website_routes.php');
}

From both of the above methods, we can detect mobile device and redirect to their specific version of website. You can choose any of these two methods.

#laravel #detect devices in laravel #how to detect mobile device in laravel #how to redirect to a mobile device #laravel detect mobile device and redirect mobile website htaccess #laravel mobile redirection

How to Configure a .htaccess Redirect

The Apache software provides a directory-level configuration called Hypertext Access  or .htaccess  file. This hidden file is usually found in your website’s public_html  folder. To modify it, [SSH]  into your server account and modify the file using your favorite command line text editor. We can also create the file ourselves and upload it to the server using[ FTP/SFTP or SCP]. Additionally, most control panels allow us to modify the .htaccess file using a native [file manager].

Your website’s .htaccess file may already contain important settings that need to remain in place. If your .htaccess file has existing settings, you will need to add the new code to what is already there. If your site was built for you and you aren’t entirely familiar with your site code, you may need to seek assistance from a designer or developer when adding new [.htaccess settings].

#wordpress #htaccess #redirect #configure

Siphiwe  Nair

Siphiwe Nair

1623202017

You are being redirected...

The Unwavering Importance of Big Data Automation in Businesses.

Inventions and discoveries of new trends in the market are getting more refined constantly. Big data automation is undoubtedly one of the most complex and troublesome technologies that is altering the dominion of technology, on a whole, significantly. However, irrespective of the complex nature of big data automation, it remains to be a crucial aspect in organizations and its multifarious benefits cannot be overlooked. The nerve of big data automation lies in finding out patterns that consist of projecting values.

The Benefits of Big Data Automation

Industries and organizations receive a deluge of data on a daily basis. Data is then analyzed to harness valuable insights from it. Reportedly, the automation of big data has induced massive benefits in the companies, improving operational competence, improved self-service modules, and increased scalability of big data technologies.

**The Promising Impact of Automation on **Data Science

In an international conference on data science and analytics, conducted by the Institute of Electrical and Electronics Engineers (IEEE), the model of big data automation was focused on. The objective of the conference was to observe and deduce the multiple ways in which big data automation can have significant impacts on data science. It was observed that the role that automation plays in data science depends on few important factors.

#big data #data science #latest news #you are being redirected #be redirected

Micheal  Block

Micheal Block

1602943200

How to Convert .htaccess Rules to NGINX Directives

NGINX is a web server that is becoming an increasingly popular option for web hosting, as sixteen percent of all sites on the internet are utilizing NGINX. This percentage is constantly increasing as clients require a web server that can serve content faster. It can also be used for proxies, reverse proxies, load balancing, and more depending on what modules you load onto NGINX. One of the significant differences between Apache (a popular webserver) and NGINX is the way each system handles access rules. If you are familiar with using .htaccess rules in Apache, then the method that NGINX uses of including directives in the server’s vhost block will be a substantial change.

We will be showing how to convert .htaccess rewrite rules to NGINX rewrite directives. The NGINX rewrite directives will also need to be placed within the server block. Many server configurations include this server block information in the vhosts file, while some use a separate NGINX configuration file (for more information about the NGINX configuration file, see Redirecting URLs Using NGINX). To complete this task, you will need to understand some basic NGINX directives I will be discussing in the next session.

Introduction to NGINX Rewrite and Return Directives

The most commonly used directives with NGINX are the return and rewrite directives. When using an NGINX directive, a client visiting a page can be directed to a different directory or a different landing page. Requests can also be redirected to an application depending on the directives you specify. For example, clients visiting the page from a smartphone can be forwarded to a script that is coded specifically for phone browsers. Another example would be to forward a client based on IP or geographical location, making your site region-specific and tailored to the visitor based on location.

NGINX Return Directive

The return directive is a bit less complicated than the rewrite directive. The best practice is to use this directive over the rewrite directive whenever possible. You will typically include the return in a server context that specifies the domains to be rewritten. I have included a common example below. Clients visiting the site will be redirected to the domain specified after the 301 status code. Using this directive will forward the client that visits www.liquidwebtest.com to www.liquidweb.com.

server {
 listen 80;
 server_name www.liquidwebtest.com;
 return 301 $scheme://www.liquidweb.com$request_uri;
 }

NGINX Rewrite Directive

The rewrite directive is somewhat different than the rewrite rules in .htaccess. It needs to be placed in a specific location or server block to rewrite the URL. The rewrite directive is usually used to perform smaller tedious tasks. For example, it is used in some cases to capture elements in the original URL or change elements in the path. The NGINX rewrite directive can get very complicated but once you understand the basic syntax it can be a lot less intimidating. I have included the basic syntax for an NGINX rewrite directive below.

rewrite regex URL [flag];

#tutorials #apache #htaccess #nginx #redirect #web server