1

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

2
  • Not clear, can you try to clarify your requirement again. Commented Jun 4, 2014 at 18:38
  • just redirect domain.com/forum/register.php to domain.com/anonpanel Commented Jun 4, 2014 at 18:45

1 Answer 1

1

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]
Sign up to request clarification or add additional context in comments.

7 Comments

i got internal server error when using htaccess, btw not domain.com but bn.domain.com
Are you sure mod_rewrite is turned on? Check your Apache error.log for reason of 500 error.
That log means mod_rewrite is not enabled. You need to enable it in Apache server.
im already update AllowOverride All in /etc/apache2/sites-available/default, and restart apache2 service
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.