php - Resolve Conflict between route name and folder name -



php - Resolve Conflict between route name and folder name -

i have problem (obviously), i'm using laravel 4.1 , made v2 of website using laravel, v1 static website (no php, lot of html files , folders).

now, want create 301 redirect because old users still have old urls in bookmark , other websites still reference me old url. when people go trough these old urls, want them redirect on new url ok (no problem that) ?

in fact when seek access old url in v2 looking new route pattern.. ok i'm gonna explain more precisly. imagine had www.example.com/en/restaurants/, path of folder restaurants on old website, have route =>

route::get('{$lang}/{$category}', postcontroller@getposts)

and type in browser www.example.com/en/restaurants/.. route won't work.. show me folder content..

i hope see mean !

thank everyone.

it serve real files , folders before ever touches routes. if you're using apache the, .htacess tell rewrite paths aren't actual paths, , same goes nginx.

there ways override this, don't it, can impact loading of assets , create lot of nasty bugs.

what suggest, not have original content in laravel public directory. best thing, compile list of of urls , have grab route @ bottom of routes file check if in list, , redirect accordingly. it's annoying , bit tedious, it's best option, honestly. perhaps config file?

<?php homecoming [ 'oldurl' => 'newurl/route' ];

php redirect laravel laravel-routing

Comments

Popular posts from this blog

model view controller - MVC Rails Planning -

ruby on rails - Devise Logout Error in RoR -

html - Submenu setup with jquery and effect 'fold' -