Solved

AliasMatch function applied to htaccess

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Article by: kevp75
Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

772 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