This forum has been moved here:
Helicon Tech Community Forum

Helicon Ape (Forum Locked Forum Locked)
 Helicon Tech : Helicon Ape
Subject Topic: Help getting rewrite regex to work
Author
Message |
GarethTnash
Groupie


Joined: 28 April 2010
Location: United Kingdom
Posts: 43
Posted: 27 October 2010 at 1:44pm

Hello,

I've been getting some help from Anton with regard to getting the APE regex to work for a series of sites that I am updating.

The current REGEX looks like -

"RewriteEngine on

SetEnv mod_seo

RewriteBase /

SeoRule ^/([^.]+)\.asp\?([^&=]+)=([^&=]+)(?:(?:&|&)([^&=]+)=([^&=]+)(?:(?:&|&)([^&=]+)=([^&=]+))?)?(?:&|&)([^&=]+in)=([^&=]+)$ /$1/$2-$3(?4/$4-$5)(?6/$6-$7)/$8-$9 [NC,L]

RewriteCond %{REQUEST_URI} !^/(?:amin|em|js|wm) [NC]

RewriteRule ^([^.]+)/([^/-]+)-([^/-]+)(?:/(.+)-([^-]+)(?:/(.+)-([^-]+))?)?/(.+in)-(.+)$ $1.asp?$2=$3(?4&$4=$5)(?6&$6=$7)&$8=$9 [NC,L]"

I think Anton must be on leave, as I've got one final query, but haven't had a response from my emails to him.

The issue that i am having is that the regular expression used to write the syntax for the URL rewriting, it appears that it is changing a URL with two parameters to a URL with two directories, which is great, but failing to read the URL with two directories as the original URL with two parameters.

 

This http://www.jb.netsolva.co.uk/job-search/s-1277/j-411/accountancy-jobs-in-aldershot

 

Should work, as it is actually http://www.jb.netsolva.co.uk/job-search.asp?s=1277&j=411&accountancy-jobs-in-aldershot

 

So in other words it changes http://www.jb.netsolva.co.uk/job-search.asp?s=1277&j=411&accountancy-jobs-in-aldershot into http://www.jb.netsolva.co.uk/job-search/s-1277/j-411/accountancy-jobs-in-aldershot

 Fine � this is perfect.

 

BUT it fails to read http://www.jb.netsolva.co.uk/job-search/s-1277/j-411/accountancy-jobs-in-aldershot as being http://www.jb.netsolva.co.uk/job-search.asp?s=1277&j=411&accountancy-jobs-in-aldershot and instead sends the user to a 404 page.

 

Please advise me how I can resolve this.

 

I need to get these updates completed as quickly as possible as my client is getting very impatient, and unfortunbatley, whilst I'm sure that APE can do what we are looking for, your instructions aren't the easiest to understand.

 

Thanks for all your help.

 

G

Back to Top
 
Vyacheslav
Admin Group


Joined: 02 July 2008
Location: Ukraine
Posts: 1542
Posted: 27 October 2010 at 6:27pm

Hello.
I’m sorry for delay. Anton is on his vacation and we’ve missed your responses.

Please try the following rule:
Code:
RewriteRule ^([^./]+)/([^/-]+)-([^/-]+)(?:/(.+)-([^-]+)(?:/(.+)-([^-]+))?)?/(.+in-.+)$ $1.asp?$2=$3(?4&$4=$5)(?6&$6=$7)&$8 [NC,L,QSA]


Thanks.

__________________
Slavik Shynkarenko,
Helicon Tech.
Back to Top Visit Vyacheslav's Homepage
 

Sorry, you can NOT post a reply.
This forum has been locked by a forum administrator.

Printable version Printable version