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

#6
(03-23-2016, 09:46 PM)skunkbad Wrote: 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

That is an interesting idea. Does it also work on the second segment of a url?
Reply


Messages In This Thread
RE: Hello. I just posted a new "tutorial" about having "truly" SEO... - by Avenirer - 03-24-2016, 12:20 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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