minu
minu

Reputation: 29

.htaccess redirect to subdirectory

We have our company websites and in that we have careers tab . All files of our company website are placed into a root folder.So for different career openings we created different pages which are being placed inside the root folder for e.g http:/mycompany.com/androidDeveloper.php.But now we want url to look differently i.e .When androidDeveloper.php is openned in Url I want it to be seen as http:/mycompany.com/Careers/androidDeveloper.php but I don't want to create new directory as mycompany.com/careers in my root directory is there any way where in above mentioned can be possible

I tried doing this in .htaccess file but doesn't seems to work

Redirect http://mycompany.com/androidDeveloper.php http://mycompany.com/careers/androidDeveloper.php

Upvotes: 2

Views: 88

Answers (1)

anubhava
anubhava

Reputation: 784918

You can try this rule in your DOCUMENT_ROOT/.htaccess file:

RewriteEngine On

RewriteRule ^careers(/.*)?$ $1 [L,NC]

Upvotes: 2

Related Questions