Solved

AliasMatch function applied to htaccess

Posted on 2009-07-10
1
985 Views
Last Modified: 2012-05-07
I had the following code in the apache conf file on a dedicated server.

.htm page that follow the regex and did not exist were redirected to pageX.php.

AliasMatch ^/[^/]+-by-[^/]+-[0-9]{7}\.htm /home/directory/public_html/page1.php
AliasMatch ^/[^/]+-by-[^/]+\.htm /home/directory/public_html/page2.php
AliasMatch ^/[^/]+\KY.htm /home/directory/public_html/page3.php
ErrorDocument 404 /404redirect.php

I have to move the site to share hosting. Could you please create a htaccess file that would do the same and would be SEO friendly.

Thank you
0
Comment
Question by:olivierarbez
1 Comment
 
LVL 27

Accepted Solution

by:
caterham_www earned 500 total points
ID: 24830159
You'll have to move mod_rewrite since you can't use directives for aliases in directory context because the mapping already occurred.
RewriteEngine on
RewriteRule ^[^/]+-by-[^/]+-[0-9]{7}\.htm$ /page1.php [L]
RewriteRule ^[^/]+-by-[^/]+\.htm$ /page2.php [L]
RewriteRule ^[^/]+\KY\.htm$ /page3.php [L]
ErrorDocument 404 /404redirect.php

Open in new window

0

Featured Post

Building an interactive eFuture classroom

Watch and learn how ATEN provided a total control system solution including seamless switching matrix switch, HDBaseT extenders, PDU, lighting control to build an interactive eFuture classroom.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question