Categories
Laravel

Laravel 5.5 – The Route::redirect method

Laravel 5.5 introduced new Router class method called redirect, which gives the flexibility to redirect to other URLs directly without creating a controller or closure. How to use Route::redirect() Let’s define a route with Route::redirect() method, if user tries to access http://localhost:8000/contact page, redirect the user to http://locahost:8000/contact-us page. The Route::redirect() is very useful method […]

Categories
Apache

.htaccess Redirect to specific Sub-Domain based on User Agent

You can use mod_rewrite’s RewriteCond directive to redirect user’s to different websites depending on what device they are using. .htaccess Rules Following rewrite rules will redirect iphone, ipad and ipod users to different sub domains based on the user agent. For all the other user agent requests, default rewrite rules will be applied.

Categories
PHP / MySQL

How to hide the PHP extension from the URLs?

In this tutorial I want to explain about hiding .php extension with URL rewriting with htaccess. What is .htaccess An .htaccess file is a simple ASCII file and it can be used to alter the configuration of the Apache Web Server software to enable/disable additional functionality and features that the Apache Web Server software has […]

Categories
zend framework 2

How to redirect to 404 page in zend Framework 2

The Zend framework automatically does this if the user selected route doesn’t exists. Although in some situations like getting data from database where the route is valid , but response is 404 (row not exits or may be row has been removed), in that case ,where may be we should have to show 404 page. […]

Categories
YII

How to redirect to previous URL in YII

If you want to get previous URL use blow line of code If you want to redirect to the previous URL use blow line of code That’s it happy coding