Gacci
Gacci

Reputation: 1398

redirecting php file regardless of what is typed after url

I am somewhat new to php, JavaScript and all those languages involved in creating a website. I was wondering how to redirect no mater what you type after a given URL i.e. when I type something else after the following url Using custom rewrite rules in Wordpress, it always redirects me to the same site. How is this accomplished?

Upvotes: 0

Views: 42

Answers (1)

Admin Alex
Admin Alex

Reputation: 177

Add the following to your .htccess file and it will redirect all pages on you domain to http://newdomain.com/page.html

RewriteEngine on
RewriteRule (.*) http://www.newdomain.com/page.html [R=301,L]

Or if you want to redirect all pages in a folder on your domain simply type:

Redirect 301 /yourfolder    http://www.newdomain.com/page.html

Thanks Admin Alex :)

Upvotes: 1

Related Questions