Solved

AliasMatch function applied to htaccess

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
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.

705 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now