views:

26

answers:

2

Hello,

I need some help. I have a page at /register. However, I also want to be able to view this register page at /book-your-place-now. I know that is possible with .htaccess but I cannot for the live of me get me head around .htaccess files.

+1  A: 

You can use mod_rewrite (it has to be enabled on your host)

RewriteEngine on
RewriteRule ^book\-your\-place\-now$ register [L]

This will make sure that if someone enters exactly http://www.domain.com/book-your-place-now the page http://www.domain.com/register will be loaded.

michal kralik
No need to escape the hyphens.
Gumbo
Good answer. I would also add that changing the `[L]` flag to `[LR]` would cause a redirect (sending the user to the '**register**' URL), which may be of some value if SEO is a concern (as duplicate content is, from what I have heard, a negative in that regard).
Lucanos
A: 

If you already have a .htaccess file add this

RewriteRule ^book-your-place-now$
register  [L] 

If not here is what you need I believe:

Options +FollowSymlinks
RewriteEngine  on

RewriteRule ^book-your-place-now$
register  [L] 

Here is a cool little tool that I used to help me understand htaccess: CoolTips.de .htaccess file generator

Ian Cant
`RewriteRule` can only check the URL path but not the protocol or host. So this won’t work.
Gumbo
Very true, sorry my mistake. I won't worry about correcting as michal kralik answer is already correct. Still say that .htaccess site above is well worth a look for anyone learning htaccess stuff.
Ian Cant