cesarferreira
cesarferreira

Reputation: 1588

Redirect custom URLs via htaccess

I have my own domain:

http://cesarferreira.com

and I wanna make

http://cesarferreira.com/github

point to

https://github.com/cesarferreira

Without having to make a /github/ folder with an index.html with a redirect for each page I own (facebook, twitter, pinterest, etc)

Is there a way like for example htaccess catchig *.com/github and pointing to a given static url?

Thanks a lot

Upvotes: 1

Views: 80

Answers (3)

Hussain
Hussain

Reputation: 5177

If your document root serves -

http://cesarferreira.com

you can put a redirect in .htaccess like -

Redirect /github https://github.com/cesarferreira

Upvotes: 3

Jon Lin
Jon Lin

Reputation: 143886

You can use mod_alias:

Redirect 301 /github https://github.com/cesarferreira

Or if you only want github to point only to the folder:

RedirectMatch 301 ^/github https://github.com/cesarferreira

You can put that in the htaccess file of your document root.

Upvotes: 1

Nick Weedon
Nick Weedon

Reputation: 451

Take a look at URL rewriter 'http://httpd.apache.org/docs/2.0/misc/rewriteguide.html'. That should be able to do everything you want and more. As long as it is enabled in apache then you can use it in .htaccess files also.

Upvotes: 1

Related Questions