Page 1 of 1

revigniter removing index.lc from URL

Posted: Sun Oct 08, 2017 11:16 pm
by pthirkell
Apologies for the newbie question, but I am learning revigniter hosted using on-rev. I would like to remove the index.lc reference from my url.

The documentation describes how to remove this as reproduced below ... but I don't understand how to create a .htaccess file or where to place it.

Any advice appreciated.

Documentation provided with revigniter

"By default, the index.lc file will be included in your URLs:

example.com/index.lc/news/article/my_article
You can easily remove this file by using a .htaccess file with some simple rules. Here is an example of such a file, using the "negative" method in which everything is redirected except the specified items:

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.lc|image|img|assets|robots\.txt|css|js)
RewriteRule ^(.*)$ index.lc?/$1 [L]
</IfModule>
In the above example, any HTTP request other than those for index.lc, images, assets, robots.txt, css and js is treated as a request for your index.lc file."

Re: revigniter removing index.lc from URL

Posted: Mon Oct 09, 2017 11:20 am
by dave.kilroy
Hey pthirkel - it's confusing because it's so simple :)

on your local system use a text editor that doesn't add invisible formatting characters such as textMate or notepad (or sublimeText, BBEdit etc) and create a file with the name ".htaccess" (warning: this may be slightly tricky to do as, depending on your settings and OS, files beginning with "." may not be displayed) - if this is a problem you can instead create the .htaccess file on the server...

Assuming for the moment you are dealing with a shared server account and are using something like cPanel, open File Manager and navigate to the domain folder (probably called the domain name where you want to pull off this 'index.lc' trick). In cPanel's File Manager, create a new file (use the +File link) and paste in the

Code: Select all

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.lc|image|img|assets|robots\.txt|css|js)
RewriteRule ^(.*)$ index.lc?/$1 [L]
</IfModule>
Save the file as '.htaccess' in the top-level (the root) of the domain folder

If you instead made the '.htaccess' file on your local computer, paste in the above content and save it, then upload to the domain root folder...

And that should be it and you should now be able to access your revIgniter urls without including 'index.lc' in them

Re: revigniter removing index.lc from URL

Posted: Mon Oct 09, 2017 11:40 am
by Thierry
Hi,

A couple of years ago, having to build a couple of complex web sites including mine,
I found the ebook .htaccess made easy very much helpful.

https://htaccessbook.com

I'm just a happy reader of this ebook, nothing more.

Regards,

Thierry

Re: revigniter removing index.lc from URL

Posted: Mon Oct 09, 2017 10:18 pm
by pthirkell
Thanks advice and it all works exactly as advertised placing .htaccess in the web-server domain root.

One tip I learned for others using C-Panel ... the 'File Manager' by default hides files beginning with dot. If you go to File Manager -> Settings and select "Show Hidden Files (dotfiles)" then voila - you see everything.

As it turns out the .htaccess file was there all along in the domain root (albeit empty) - I just couldn't see it.

Thanks also for the .htaccess book tip.

cheers!