-1

I have a website running on Apache.

I would like to create a forward such that if I access http://helpdesk.example.com/otrs/anyname (except customer.pl) this redirects to http://helpdesk.example.com/otrs/customer.pl

Also I'd like to not show the path of the website in the URL:

helpdesk.example.com/otrs/customer.pl displayed as helpdesk.example.com.


Thank you for answers..

Some is wrong...

in var/www/ is index.html

<meta http-equiv="refresh" content="0;url=http://helpdesk.example.com/otrs/customer.pl">

and at this moment is .htaccess

Options +FollowSymLinks
RewriteEngine On

RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f

RewriteRule ^/(.*)$ ./customer.pl?query=$1
enter code here

It isn't working...

Sven
  • 97,248
  • 13
  • 177
  • 225
  • 2
    `Also I'd like to not show the path of the website in the URL` For this you will need [mod_proxy](http://httpd.apache.org/docs/2.2/en/mod/mod_proxy.html). For URL rewriting you will need [mod_rewrite](http://httpd.apache.org/docs/2.2/en/mod/mod_rewrite.html). Then, showing us somethings you have tried and explain what is not working would be great, as we are not really here to do the full job for you, but here to provide some guidance... – krisFR Jun 01 '15 at 20:39

1 Answers1

0

You might set up an .htaccess file with something similar to the following:

Options +FollowSymLinks
RewriteEngine On

RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f

RewriteRule ^/(.*)$ ./customer.pl?query=$1

The RewriteCond %{SCRIPT_FILENAME} !-d and RewriteCond %{SCRIPT_FILENAME} !-f are included to avoid redirecting files that do exist such as CSS, JS, or images.

More information is here.

Andrew Schulman
  • 8,561
  • 21
  • 31
  • 47
pcnate
  • 101
  • 1
  • 3