User Tools

Site Tools


new_rotation_faq

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
new_rotation_faq [2019/08/26 15:48]
admin [How much memory consumes cache]
new_rotation_faq [2019/09/13 15:17] (current)
admin [Rotation - Groups shows that I have 10 galleries while Rotation - List thumbs - 20]
Line 1: Line 1:
 ====== New Rotation FAQ ====== ====== New Rotation FAQ ======
 +
 +===== What is mod_rewrite =====
 +
 +mod_rewrite - That's an addon that helps to create nice URLs that do not exist on server. There'​s a mod for nginx and lighttpd as well.
 +
 +Let's let by default you have urls like http://​domain/​gallery/​cool-gallery/​index.html,​ in fact there'​s no such path /​gallery/​cool-gallery/​index.html on server. Mod_rewrite transforms it into http://​domain/​scj/​tube/?​slug=cool-gallery , "​nice"​ URL is for SE and users.
 +
 +.htaccess is a file that sets a list of these rewrite urls for apache. ​
 +
 +
 +I'll try to explain how it works:
 +
 +As I said before there'​s such path as /​gallery/​cool-gallery/​index.html on server. You have to use an url like /​scj/​cgi/​out.php?​url=content&​slug=cool-gallery to see a gallery, and this url doesn'​t look nice. That's why we add a special rule into .htaccess that says how to transform urls 
 +
 +
 +RewriteRule ^gallery/​(.*)/​index.html$ /​scj/​cgi/​out.php?​url=content&​slug=$1
 +
 +That means if URL starts with  gallery/, then we have "​something"​ (.*) upto "/"​ symbol, and then it ends with "/​index.html"​ - we have to transform it into /​scj/​cgi/​out.php?​url=content&​slug=$1 where $1 is something that was in (.*)
 +
 +Inn this example $1 = "​cool-gallery"​. So Apache will transform it into  /​scj/​cgi/​out.php?​url=content&​slug=cool-gallery and you'll see a gallery.
 +
 +You see urls like /​gallery/​cool-gallery/​index.html at your site because you have something like href="/​gallery/<​!--GALLERY_SLUG-->/​index.html in your templates
 +
 +That means that if you'd like to change URLs - you need to change rewrites.
 +
  
 ===== Rotation - Groups shows that I have 10 galleries while Rotation - List thumbs - 20 ===== ===== Rotation - Groups shows that I have 10 galleries while Rotation - List thumbs - 20 =====
new_rotation_faq.txt ยท Last modified: 2019/09/13 15:17 by admin