Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

AliasMatch function applied to htaccess

Posted on 2009-07-10
1
Medium Priority
?
998 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 27

Accepted Solution

by:
caterham_www earned 2000 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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 …
Fine Tune your automatic Updates for Ubuntu / Debian
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…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Suggested Courses

604 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