Sunday, 15 May 2011

Apache mod-rewrite for shorter urls -


Is it possible that you do something with rewriting it?

Current URL:

www.example.com/Departments/dynamicPage.php?DeptID=10&DeptName=HR

Set up a rewrite: < / P>

 www.example.com/hr 

Can be redirected to the above (with arguments)?

I know that I can create a "bell" folder at the root level and can add an html page with meta refresh, but I hate the extra disorder.

I do not think that .htaccess 301 is possible, but please correct me if I am wrong. I am looking for a great solution which can be added for future examples.

It looks like anything should do the trick on its lines:

  RiverRightium ^ HR $ / Departments / Dynamic Page DPIPID = 10 & DIPName = HR [L]  

If you make it normal:

  rewrite% {REQUEST_FILENAME}! -f rewrite code% {REQUEST_FILENAME}! -d Recruitment Rule ^ (.) $ / / Departments / Dynamic Page. ? DeptID = 10 & amp; DeptName = $ 1 [L]  

Of course, you need to be careful about those people who are not actually present, and you will need to do this to make sure that your All names mean.

If you want a 301 redirect, use [R = 301] or [L, R = 301] to rewrite the rule .


No comments:

Post a Comment