Advertisement

Siteground hosting and /index.php removal

Need help with the Administration of your Joomla! 5.x site? This is the spot for you.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10
Post Reply
User avatar
trogladyte
Joomla! Guru
Joomla! Guru
Posts: 656
Joined: Sat May 03, 2008 9:27 pm
Location: Phoenix, AZ
Contact:

Siteground hosting and /index.php removal

Post by trogladyte » Thu Mar 20, 2025 6:53 pm

I have just added a site to Siteground - the first time I've ever used them. Apart from their very strange naming conventions for DB user & name, it's been a pretty good experience.

However, I've run into a problem when trying to remove the /index.php from the end of the URL. All my other sites are on Liquid Web and I have a piece of code I use in .htaccess each time that works flawlessly. However, with SG, it causes the site not to display the internal pages (yes, I have the toggle set under site config!! :laugh: ).

The code I usually use is:

Code: Select all

#### Force HTTPS://WWW and remove trailing / from files ####
## Turn on rewrite engine
RewriteEngine on

# Remove trailing slash from non-filepath urls
RewriteCond %{REQUEST_URI} /(.+)/$
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ https://www.sitename.com/%1 [R=301,L]

# Include trailing slash on directory 
RewriteCond %{REQUEST_URI} !(.+)/$
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+)$ https://www.sitename.com/$1/ [R=301,L]

# Force HTTPS and WWW 
RewriteCond %{HTTP_HOST} !^www\.(.*)$ [OR,NC]
RewriteCond %{https} off  
RewriteRule ^(.*)$ https://www.sitename.com/$1 [R=301,L]
For SG gurus, what's wrong with this code? Thanks!
Ian Shere - Phoenix Website Design & Hosting
http://www.citruskiwi.com
Survey Pilot - Surdex.com
“Learn from the mistakes of others. You won’t live long enough to make all of them yourself.”

Advertisement
User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 45084
Joined: Sat Apr 05, 2008 9:58 pm

Re: Siteground hosting and /index.php removal

Post by Webdongle » Thu Mar 20, 2025 9:54 pm

http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

User avatar
trogladyte
Joomla! Guru
Joomla! Guru
Posts: 656
Joined: Sat May 03, 2008 9:27 pm
Location: Phoenix, AZ
Contact:

Siteground hosting and /index.php removal

Post by trogladyte » Thu Mar 20, 2025 11:03 pm

Thanks, WebDongle, I'd never seen that article before. That said, I haven't experienced this issue before either!

I worked through the "Step by Step" portion of article, and checked that mod_rewrite was enabled (it was), but it still failed when "Use URL Rewriting" was turned on. The SEF plugin was already enabled by default. I cannot access httpd.conf, as it's shared hosting.

So I got onto tech support at Siteground. There was one line I did not have in my .htaccess which they added. I guess my setup at Liquid Web must deal with this globally as I've never had this issue.

INSTANT UPDATE: FAIL! The line they added was

Code: Select all

RewriteRule ^(.*)$ index.php [L]
which made the frontend work as I wanted but 404'd the administrator. I was once tempted to move my hosting to Siteground. So glad I didn't.
Ian Shere - Phoenix Website Design & Hosting
http://www.citruskiwi.com
Survey Pilot - Surdex.com
“Learn from the mistakes of others. You won’t live long enough to make all of them yourself.”

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 45084
Joined: Sat Apr 05, 2008 9:58 pm

Re: Siteground hosting and /index.php removal

Post by Webdongle » Thu Mar 20, 2025 11:58 pm

Never had any problems on Host sites using Joomla's .htaccess
But on localhost I need to set an Alias in wamp to the Joomla folder.
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

User avatar
trogladyte
Joomla! Guru
Joomla! Guru
Posts: 656
Joined: Sat May 03, 2008 9:27 pm
Location: Phoenix, AZ
Contact:

FIXED - Moved hosts!! Siteground hosting and /index.php removal

Post by trogladyte » Sat Mar 22, 2025 4:25 pm

Yeah I couldn't figure it out. Something about how Siteground's shared hosting is set up. I moved the site to my hosting on Liquid Web, did the usual changes, and zero problems, it's working fine. Thank goodness the client's hostin gon SG expires this May so he didn't care if I moved it.
Ian Shere - Phoenix Website Design & Hosting
http://www.citruskiwi.com
Survey Pilot - Surdex.com
“Learn from the mistakes of others. You won’t live long enough to make all of them yourself.”

Advertisement

Post Reply

Return to “Administration Joomla! 5.x”