• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Hello. I just posted a new "tutorial" about having "truly" SEO urls

#4
I never like doing something with PHP that the server can do better. If you are on an Apache server with mod_rewrite enabled:


Code:
RewriteRule ^(.*)_(.*)$ $1-$2 [N,E=redirect:true]
RewriteCond %{ENV:redirect} ^true$
RewriteRule (.*) $1 [R=301]


By doing this you will just have a single redirect at the server level, and if CodeIgniter can't route to the URL it will just 404. No core extensions required.

Credit: https://www.geoffhayward.eu/2014/04/char...od-rewrite
Reply


Messages In This Thread
RE: Hello. I just posted a new "tutorial" about having "truly" SEO... - by skunkbad - 03-23-2016, 09:46 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.