revigniter removing index.lc from URL

This is the place to discuss the LiveCode Hosting service.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
pthirkell
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 93
Joined: Tue Nov 17, 2009 6:47 pm
Location: Wellington, New Zealand

revigniter removing index.lc from URL

Post by pthirkell » Sun Oct 08, 2017 11:16 pm

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."

dave.kilroy
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 858
Joined: Wed Jun 24, 2009 1:17 pm
Location: Plymouth, UK
Contact:

Re: revigniter removing index.lc from URL

Post by dave.kilroy » Mon Oct 09, 2017 11:20 am

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
"...this is not the code you are looking for..."

Thierry
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 875
Joined: Wed Nov 22, 2006 3:42 pm

Re: revigniter removing index.lc from URL

Post by Thierry » Mon Oct 09, 2017 11:40 am

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
!
SUNNY-TDZ.COM doesn't belong to me since 2021.
To contact me, use the Private messages. Merci.
!

pthirkell
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 93
Joined: Tue Nov 17, 2009 6:47 pm
Location: Wellington, New Zealand

Re: revigniter removing index.lc from URL

Post by pthirkell » Mon Oct 09, 2017 10:18 pm

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!

Post Reply

Return to “LiveCode Hosting”