301 redirect

Helicon Ape provides support for Apache .htacces and .htpasswd configuration files for Microsoft IIS.
User avatar
Posts: 13
Joined: 29 Apr 2013, 03:46

301 redirect

29 Apr 2013, 03:47

Hello,

Please can you help me..

I try set 301 redirect exemple

http://www.somewebsite.com/some-stuff-i-another-283/ >>> http://www.somewebsite.com/some-stuff-i-another/

i create map.txt and put
/some-stuff-i-another-283/ /some-stuff-i-another/

and in htaccess i set:
# Rewrite old category urls
RewriteMap map txt:mapfile.txt [NC]
RewriteCond %{REQUEST_URI} ^(.+)$ [NC]
RewriteCond ${map:%1|NOT_FOUND} !NOT_FOUND
RewriteRule .? ${map:%1} [NC,R=301,L]

But not work

please can you advise me and please i need help.

regards

User avatar
Posts: 871
Joined: 12 Mar 2012, 09:54

Re: 301 redirect

29 Apr 2013, 06:31

Hello,

Please try to have the following config:

RewriteEngine On
# Rewrite old category urls
RewriteMap map txt:mapfile.txt [NC]
RewriteCond %{REQUEST_URI} ^(.+)$ [NC]
RewriteCond ${map:%1|NOT_FOUND} !NOT_FOUND
RewriteRule .? ${map:%1} [NC,R=301,L]

If it still doesn't work, please enable logging in httpd.conf by uncommenting

RewriteLogLevel 9

and provide rewrite.log records for the test request.

User avatar
Posts: 13
Joined: 29 Apr 2013, 03:46

Re: 301 redirect

29 Apr 2013, 07:08

This is my htacces


************
RewriteEngine On
#RewriteCompatibility2 On
#RepeatLimit 200
RewriteBase /


RewriteCond %{HTTP:Host} ^somewebsite\.com$ [NC]
RewriteRule (.*) http://www.somewebsite.com$1 [NC,R=301,L]

RewriteRule ^([0-9a-zA-Z_-]+)/news/$ /news.asp?code=$1 [NC,L]
RewriteRule ^([0-9a-zA-Z_-]+)/manufacture/$ /manufacture.asp?man=$1 [NC,L]
RewriteRule ^([0-9a-zA-Z_-]+)/manufacture/(\d+)/$ /manufacture.asp?man=$1&Page=$2 [NC,L]

RewriteRule ^([^/]+)/$ /category.asp?cate=$1 [NC,L]
RewriteRule ^([0-9a-zA-Z_-]+)/(\d+)/$ /category.asp?cate=$1&Page=$2 [NC,L]
RewriteRule ^([0-9a-zA-Z_-]+)/([0-9a-zA-Z_-]+)/$ /subcategory.asp?subcate=$1&cate=$2 [NC,L]
RewriteRule ^([0-9a-zA-Z_-]+)/([0-9a-zA-Z_-]+)/(\d+)/$ /subcategory.asp?subcate=$1&cate=$2&Page=$3 [NC,L]



RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/([^?+]+)(?:\+([^?]+))?$ /product.asp?product=$1&code=$2?3\%2B$3 [NE,NC,L]



RewriteEngine On
# Rewrite old category urls
RewriteMap map txt:mapfile.txt [NC]
RewriteCond %{REQUEST_URI} ^(.+)$ [NC]
RewriteCond ${map:%1|NOT_FOUND} !NOT_FOUND
RewriteRule .? ${map:%1} [NC,R=301,L]
*******************


I try your suggestion but not work...


Hmm , i check ******httpd.conf by uncommenting RewriteLogLevel 9 ******

i dont have in my wwwroot httpd.conf , only web.config, i dont how to enable rewrite.log... sorry...


please can you advise me and please i need help.

Many thanks

User avatar
Posts: 871
Joined: 12 Mar 2012, 09:54

Re: 301 redirect

29 Apr 2013, 08:09

Hello,

httpd.conf file in located in Ape installation folder.
Please find it, uncomment the "RewriteLogLevel 9" directive and send us the excerpt of the rewrite.log for your test request.

User avatar
Posts: 13
Joined: 29 Apr 2013, 03:46

Re: 301 redirect

29 Apr 2013, 08:35

I uncomment the "RewriteLogLevel 9" but noting show in rewrite.log, not show any error...
Attachments
logg.jpg
logg.jpg (141.64 KiB) Viewed 73481 times

User avatar
Posts: 13
Joined: 29 Apr 2013, 03:46

Re: 301 redirect

30 Apr 2013, 10:40

Hi,

i check today rewrite.log and still empty..

please can you advise me and please help.

Many thanks

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: 301 redirect

01 May 2013, 18:09

I'm afraid Anton wasn't clear enough. Please, uncomment the part with rewrite.log also. These two lines work together. One enables logging, the second one specifies the how detailed it's going to be.

Regards
Andrew

User avatar
Posts: 13
Joined: 29 Apr 2013, 03:46

Re: 301 redirect

02 May 2013, 01:59

Hi Andrew,

RewriteLog rewrite.log
RewriteLogLevel 9 its uncomment ...

I try exemple www.somewebsite.com/some-stuff-i-another-283/ open this url and open HTTP 500 , not redirect to work url, i check now error.log and rewrite.log its empty again...

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: 301 redirect

02 May 2013, 09:53

This probably means that Ape doesn't have permissions to write into the file.
Please, follow this artcile, to resolve the issue (it may laso be related to mapfiles you're trying to use) - http://www.helicontech.com/isapi_rewrite/doc/security.htm

Regards
Andrew

User avatar
Posts: 13
Joined: 29 Apr 2013, 03:46

Re: 301 redirect

03 May 2013, 02:50

Ni, thanks for update,

i check installation directory and it System account has full access...
Attachments
ape2.jpg
ape2.jpg (117.93 KiB) Viewed 73438 times
ape1.jpg
ape1.jpg (97.84 KiB) Viewed 73438 times

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: 301 redirect

03 May 2013, 18:54

It also says about NETWORK_SERVICE> This one has always be a saver for me. Try that.

Regards
Andrew

User avatar
Posts: 13
Joined: 29 Apr 2013, 03:46

Re: 301 redirect

04 May 2013, 04:32

Thanks for info...
i can find NETWORK SERVICE group.. this is windows server 2012 and iis 8.0.9200.16384 i try difrent solution but i cant find anyting

if you got some more info... please i need help.

regards

User avatar
Posts: 13
Joined: 29 Apr 2013, 03:46

Re: 301 redirect

04 May 2013, 06:26

I found problem way rewrite.log its empty...

i send log in .rar pasword i send in PM.
Attachments
revritelog.rar
send pass in PM
(11.12 KiB) Downloaded 1505 times

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: 301 redirect

05 May 2013, 19:00

a) How did you fix it?
b) In your rewrite.log you have requests to jpeg, css, png, js files and product.asp. There's nothing that would satisfy your rule.

See, erach request is processed by applying each rule in your config file to the incoming request.
You can easily now find the testing request section by looking at log. Each request processing start with a line:

Code: Select all
init rewrite engine with /XXXXX/XXXX-XXX.XXX

Try to make a log once again a tell us the request you used and send its particular part of the log.

Regards
Andrew

User avatar
Posts: 13
Joined: 29 Apr 2013, 03:46

Re: 301 redirect

06 May 2013, 08:41

Hi,

a) I move rewrite.log from Program Files (x86)\Helicon\Ape\ManualInstall to Program Files (x86)\Helicon\Ape and work

b) attached is the log, the password is the same, but it looks like it does not work 301 redirect, which is given by rule... Rewrite rul work ok...


301 redirect exemple

http://www.somewebsite.com/some-stuff-i-another-283/ >>> http://www.somewebsite.com/some-stuff-i-another/

i create map.txt and put
/some-stuff-i-another-283/ /some-stuff-i-another/

and in htaccess i set:
# Rewrite old category urls
RewriteMap map txt:mapfile.txt [NC]
RewriteCond %{REQUEST_URI} ^(.+)$ [NC]
RewriteCond ${map:%1|NOT_FOUND} !NOT_FOUND
RewriteRule .? ${map:%1} [NC,R=301,L]
Attachments
log-helicon.rar
(1.43 KiB) Downloaded 1476 times

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: 301 redirect

06 May 2013, 09:57

I still do not see the testing request in the log. That would be a problem I'd pay attention to.
I can see the pattern in the log that corresponds to your rule, butI do not see how the testing request is processed.

Regards
Andrew

User avatar
Posts: 13
Joined: 29 Apr 2013, 03:46

Re: 301 redirect

06 May 2013, 10:17

Hi, Andrew

thanks for great help, but i dont know what to do next. I uncomment rewrite.log and
RewriteLogLevel 9 ... then i click a missing link, but not executed redirections but server shows 500 error webpage... that everything should be very simple but it is not :)

really do not know what to do next.

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: 301 redirect

06 May 2013, 10:38

When you enabled logs, do you click for /some-stuff-i-another-283/ ?
IF so, we need to find out why it doesn't show up in the logs, and we see only product.asp.
You masked the name of your site in the logs(somesite.com), but is it the same site that we're working on? Or is it requests that come to a different site, not the one that we're dealing with?

Regards
Andrew

User avatar
Posts: 13
Joined: 29 Apr 2013, 03:46

Re: 301 redirect

06 May 2013, 10:58

Hi,

do you click for /some-stuff-i-another-283/ Yes
but is it the same site that we're working on? Yes, the same site, on the same server.

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: 301 redirect

06 May 2013, 11:05

Email us with a reference to this ticket. We'll be happy to remotely connect to your server and take a look.

Regards
Andrew

Return to Helicon Ape

Who is online

Users browsing this forum: No registered users and 27 guests