5

My question pertains specifically to the two pages below, but is also more generally relating to methods for using clean URLs without an .htaccess file.

http://www.decitectural.com/ and http://www.decitectural.com/about/

The pages above are hosted on Amazon's S3, which does not allow for the use of htaccess files. As a result, I have found no easy way to create a clean url rewrite scheme that sends all requests to an index file which, in turn, interprets the URL using javascript and loads up the correct page (with AJAX, or, as is the case with decitectural, with simple div visibility toggling).

In order to circumvent this problem, I usually edit the amazon S3 bucket properties and set both the index page and the error page to the index.html file. In this case, the index.html file is served even when an invalid path (such as /about/) is requested. This has, for the most part, been a functioning solution... That is, until I realized that I was also getting a 404 with the index.html page which would stop Google from indexing it.

This has led me to seek out an alternative solution to this problem. Currently, as a temporary fix, I am actually creating the /about/ directory on the server with a duplicate of the index.html file in it. This works, but obviously is not a real solution to the problem.

I would appreciate any advice on how to set up a clean URL routing scheme on S3 or in any instance where an .htaccess file can't be used.

adekom
  • 216
  • 2
  • 10

2 Answers2

0

Here's a few solutions: Pretty URLs without mod_rewrite, without .htaccess

Also, I guess you can run a script to create the files dynamically from an array or database so it generates all your URLs:

  • /index.html
  • /about/index.html
  • /contact/index.html
  • ...

And hook the script on every edit, in a cron or run manually. Not the best in terms of performance but hey, it should work.

Community
  • 1
  • 1
Xavi Esteve
  • 1,114
  • 2
  • 19
  • 35
0

I think you are going about it the wrong way. S3 gives you complete control of the page structure of your site. If you want your link to be "/about", just upload a file called "about", and you're done. (Set the headers so that the browser knows it's HTML.)

Yes, it will break if someone links to "/about/" or "/about.html". But pretty much any site will break if you mess with their links in odd ways. You will have to be vigilant when linking to your own site, because you won't have any rewrite rules to clean up for you. But you should have automation doing that.

BraveNewCurrency
  • 12,654
  • 2
  • 42
  • 50