Putra Fajar Hasanuddin
Putra Fajar Hasanuddin

Reputation: 1193

Using .htaccess redirect php url to another

I recently make subdomain for my VPS, I want redirect .php in URL

http://bn.domain.com/forum/register.php

I'd like them to be redirected to the appropriate URL:

http://bn.domain.com/anonpanel/

How can I do that?

[Wed Jun 04 20:10:57 2014] [alert] [client 202.62.25.9] /var/www/forum/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration [Wed Jun 04 20:11:01 2014] [alert] [client 202.62.25.9] /var/www/forum/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration [Wed Jun 04 20:13:01 2014] [alert] [client 114.79.13.26] /var/www/forum/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration [Wed Jun 04 20:13:03 2014] [alert] [client 114.79.13.26] /var/www/forum/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration

Upvotes: 1

Views: 346

Answers (1)

anubhava
anubhava

Reputation: 785481

You can use this rule in /forum/.htaccess file:

RewriteEngine On
RewriteBase /forum/

RewriteCond %{HTTP_HOST} ^bn\.domain\.com$ [NC]
RewriteCond %{THE_REQUEST} /register\.php[?/\s] [NC]
RewriteRule ^ /anonpanel [L,NC,R]

Upvotes: 1

Related Questions