Does anyone know if it is possible to have a path alias for the front page? Everything I've tried doesn't work.

Comments

gforce301’s picture

Why would you need a path alias for the front page? It is the root page of the site. It is always found at http://example.com, which is sometimes an alias already if you used a node as your front page instead of the default front page or a view.

harrisben’s picture

It's not absolutely necessary, but I am seeking it maintain the paths of an already established site.

I've set the path alias for the content that is on the front page to the relevant path so it is still available at the path and I've set the content that was on the front page to the front page.

Basically, everything except the path of the front page is exactly as it was and I was simply interested to know if it is possible or not (not that it is crucial for it to be able to).

gforce301’s picture

I guess I have never tried it. I suppose trying to make an alias of '' -> 'somepath' (read nothing to somepath) does not work. Similarly '/' -> 'somepath' probably does not work either. That leaves you with the Path redirect module or making a redirect in your .htaccess file.

betz’s picture

You can give as path to the frontpage. This works

Hmm look slike i cant type that in this forum. You can use node or < f r o n t > (without the spaces)

harrisben’s picture

Hi Betz,

I've tried both of those and node doesn't work (it masks the path). is not accepted as a valid path by the path module too.

Jeff Burnz’s picture

normally you'd do a 301 redirect - heres a primer http://drupal.org/node/38960

otherwise it rather depends on how you're setting up the front page, but in essence you always need to go the Site Information settings and set whatever path you want for the homepage there (that path must exist, or else you'll get a 404 for your homepage I would imagine).

alienzed’s picture

Use a theme template to 'be' your front page. (front--page.tpl.php by the way). Then set your front page to 'node' or something and your Path Alias can also point to whatever your front page is.
If you don't have a template for your front page, copy the html from the current front page and stick it into the template, voila. Replace dynamic areas as required...