GetDotted Domains

Viewing Thread:
"Web address index.php removal"

The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.

Mon 17/11/14 at 20:03
Regular
Posts: 3
My website is all finished and up and running now, final minor thing is i hate how to address bar reads,
address.co.uk/index.php/news
address.co.uk/index.php/contact

and so on, how do I set up url rewriting so it says

address.co.uk/news
address.co.uk/contact
etc

I know there are some ways of doing it using the .htaccess file, but I hear that is not the best/correct way.

My domain and hosting is all held with freeola so hoping someone has come across this and knows the best manor in which to amend the addresses!

Thank you for any advice.
Mon 17/11/14 at 22:41
Staff Moderator
"Aargh! Broken..."
Posts: 1,408
I'm guessing you're using a framework or CMS of some sort. I don't think there is anything wrong with your file and folder structure.
You should be able to do what you require using .htaccess, nothing wrong with that.
You need something like this in your .htaccess file, which should be located in your web root (htdocs):

RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]


This code will ensure that the Apache (webserver) loads the rewrite module, it will then cause the web server to take everything after index.php to be rewritten to /, so yoursite.com/index.php/news should end up being working if a visitor attempt to visit yoursite.com/news.
It will exclude images and robots.txt.
Mon 17/11/14 at 22:15
Regular
"Feather edged ..."
Posts: 8,536
Hi DeaconBlues ... welcome

Seems to me, and I'm no expert, that you have a link and folder problem.

Your main file ... 'index.php' should sit in .htaccess file with all its associated required files.

Any 'pages/content' should be within a separate folder within the .htaccess file and linked to accordingly e.g

"News/whatever"

Create a News folder, save it within .htaccess folder, within the 'News' folder create your content. To link ... see above
Mon 17/11/14 at 20:03
Regular
Posts: 3
My website is all finished and up and running now, final minor thing is i hate how to address bar reads,
address.co.uk/index.php/news
address.co.uk/index.php/contact

and so on, how do I set up url rewriting so it says

address.co.uk/news
address.co.uk/contact
etc

I know there are some ways of doing it using the .htaccess file, but I hear that is not the best/correct way.

My domain and hosting is all held with freeola so hoping someone has come across this and knows the best manor in which to amend the addresses!

Thank you for any advice.

Freeola & GetDotted are rated 5 Stars

Check out some of our customer reviews below:

Thanks!
Thank you for dealing with this so promptly it's nice having a service provider that offers a good service, rare to find nowadays.
Excellent support service!
I have always found the support staff to provide an excellent service on every occasion I've called.
Ben

View More Reviews

Need some help? Give us a call on 01376 55 60 60

Go to Support Centre

It appears you are using an old browser, as such, some parts of the Freeola and Getdotted site will not work as intended. Using the latest version of your browser, or another browser such as Google Chrome, Mozilla Firefox, or Opera will provide a better, safer browsing experience for you.