Webtrees Pretty URLs

0 0 vote
Article Rating

What are Webtrees Pretty URLs

Webtrees pretty URLs turns your URL from something like this yoursite.com/index.php?route=%2Ftree%2Fsmith to something like this yoursite.com/tree/smith

When Webtrees is first installed its URLs (the end part of the URL)  will look something like this yoursite.com/index.php?route=%2Ftree%2Fsmith

An URL written in the above way has no effect on how your site will be viewed by search engines but the above URL is not easy for people to remember or type and Google recommends they should be as simple to read by people as possible.

Activating webtrees pretty URLs will turn the above URL into something more memorable such as yoursite.com/tree/smith.

Activating Your URLs

the following instructions assume Webtrees is your main site and your files are in your public_html folder. If that is not the case and your files are in a sub-domain at public_html/webtrees/ folder you need to read the sub-domain instructions at the bottom of the page before you begin.

Activating Webtrees Pretty URLs is done from your main cPanel page. Click on public_html in the left-hand column so its contents are open in the main column.

At the top of the screen you should click on the ‘Settings‘ button on the right hand side and then click in the ‘Show hidden files‘ setting, and then ‘Save‘.

In the top index click on the ‘File‘ button to create a new file.

Name the new file should be named .htaccess and then click on the ‘Create New File‘ button.

Your new .htaccess file should now be visible in the central area of you cPanel page. If it isn’t, click on the ‘Reload‘ button to reload the page.

Find your .htaccess file and click on it to select it, then click on the ‘edit‘ button from the top menu and open the file for editing.

Once open, copy and past the following code into your file before saving the file.

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

It should look like the following image

Webtrees Pretty URLs

There is one more change you need to make and that is to the data/config.ini.php file

Making sure you are still in the right place by clicking on public_html in the left hand column so its contents are displayed in the main column.

In the main column find the ‘data‘ folder and double click on it to display its contents.

Select the ‘config.ini.php’ file, then the ‘Edit’ button from the top menu.

At the bottom of that file you should find your website URL listed in the following format
base_url="https://yourWebsite.com"

If your URL is not listed, you need to add it.

Directly under the URL, on the next line, you need to add the following code
rewrite_urls="1"

When you next open your website your URLs should have changed from something like this yoursite.com/index.php?route=%2Ftree%2Fsmith to something ‘pretty’ like this yoursite.com/tree/smith

Sub-domain Instructions

If your files are in a sub-domain at public_html/webtrees/ then the code you should add to your .htaccess file should have the ‘Webtrees’ folder added to the second line as follows:

RewriteEngine On
RewriteBase /webtrees/
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

and your base URL in your data/config.ini.php file would also have the same folder added as follows

base_url="https://yourWebsite.com/webtrees"

0 0 vote
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x