Forum Moderators: phranque

Message Too Old, No Replies

htaccess syntax question

         

David Bruning

10:40 pm on Aug 8, 2005 (gmt 0)

10+ Year Member



say I have an older set of pages with a URL like:

[domain.com...]

and the 1 goes up to a max of 900.php

Can someone provide the htaccess expression to redirect any pages that came in using the old url to htt://www.domain.com/subject/

Working on it myself, but I had assumed I had the expression all set...and moved it over to the live server. Since everything else is running perfectly, am just going to leave it until I get the htaccess as intended.

Here's what I have so far:
Redirect 301 ^(.*)/([^/.]+)\.php$ [domain.com...]

As always, appreciate the help! :)

David

David Bruning

10:56 pm on Aug 8, 2005 (gmt 0)

10+ Year Member



k, I chose to go with this instead:

RewriteRule ^(.*)/([^/.]+)\.php$ [domain.com...] [R=301,L]

and that seems to be working, have a different issue but I'm going to work on it before I bring it up here :)

jdMorgan

11:39 pm on Aug 8, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Which parts of the URL are fixed and which are variable? For example, is "subject" variable? If so, is it always a certain set of characters, like all-lowercase letters? A certain number of characters?

You should make your pattern(s) as specific as possible in order to improve efficiency.

To match a one-to-three digit number, the regex is [0-9]{1,3}

Jim