Solved

AliasMatch function applied to htaccess

Posted on 2009-07-10
1
982 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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
web & database SERVERS -- PHYSICAL & VM ? 5 72
winscp 000webhost.com 6 74
Redirect to catagorie in case of 404 4 23
Redhat upgrade 1 25
If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

860 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