January 29, 201214 yr Hi, Just a quick question, when I upload, the server will automatically redirect any visitor to the index.html file. But I've seen on bigger sites that the first page is just the domain name without the index.html extension showing up. How do I do that? Thanks.
January 29, 201214 yr what is the name of the file u given to the page u uploaded? rename it to index.html
January 29, 201214 yr Author I have re-named it it index.html So the landing page is: www.example.co.uk/index.html What I want is the landing page to be: www.example.co.uk
January 29, 201214 yr Author Did that too. It just automatically sends you to www.example.co.uk/index.html My home site is: jejune-jejune.co.uk enter that add in, it will just go straight to jejune-jejune.co.uk/index.html
January 31, 201214 yr Hi there, The reason for this is simply you have a 301 redirect instigated on your domain. I did a quick check and it returns this: Checked link: http://www.jejune-jejune.co.uk Type of redirect: 301 Moved Permanently Redirected to: http://www.jejune-jejune.co.uk/index.html/ 301 Redirects are headers sent to the browser for instructional purposes. Basically if anyone accesses the root domain, http://www.jejune-jejune.co.uk, they are being redirected to the index.html/ page automatically. Depending on your hosting environment this is probably applied in your .htaccess file. If you cannot see this try looking for a setting in your FTP client for "Show hidden files" or similar, as some clients hide it for security or to prevent accidental editing. If you're still stuck, contact your host. This is not usually something that can be setup by accident as it's been specified somewhere, but as I say, it depends on your hosting environment. Hope this helps.
January 31, 201214 yr Hi, No worries at all. As I say it depends how this 301 has been put in place, whether it's in a .htaccess or via an option in your control panel so have a look around. If you get stuck just reply here and I'll help if I can. Cheers.
February 1, 201214 yr how to make 301 redirect using .htaccess put it inside public_html folder RewriteCond %{REQUEST_URI} /index\.html?$ [NC] RewriteRule ^(.*)index\.html?$ "/$1" [NC,R=301,NE,L] u can try this code too in ur .htaccess file how to find .htsccess file on ur server Edited February 1, 201214 yr by sash_oo7
February 1, 201214 yr how to make 301 redirect using .htaccess put it inside public_html folder RewriteCond %{REQUEST_URI} /index\.html?$ [NC] RewriteRule ^(.*)index\.html?$ "/$1" [NC,R=301,NE,L] u can try this code too in ur .htaccess file how to find .htsccess file on ur server He already has a 301 redirect in place which is causing his issue. If, as assumed, his issue is that he just wants the root URL to display upon page load, i.e. http://www.yourdomain.com instead of http://www.yourdomain.com/index.html he won't need any redirects in his .htaccess as this is normal behaviour. You're also assuming his hosting/server has mod_rewrite enabled, which some don't, in which case your above code won't work. It's also good practise to initialise the RewriteEngine before writing rules, again assuming mod_rewrite is enabled. Hope this helps, let us know how you get on!
February 8, 201214 yr Author Sorry for the delay. Been abit busy. Figured it out though. It was actually my own fault. What I did wrong was zip the folder containing the web files then upload it to the public folder. The mistake I made was to rename the folder containing the web files to index.html, instead of just moving them outside of the zip folder. Thanks for the help, it's much appreciated.
Create an account or sign in to comment