| Author |
|
rory_a Newbie

Joined: 08 June 2010
Online Status: Offline Posts: 15
|
| Posted: 08 June 2010 at 12:53pm | IP Logged
|
|
|
I'm developing a new e-commerce site to replace my
current .asp site.
I need to redirect a large number of pages to new ones,
and a basic rule will not work for me. Basically, I need
to redirect a specific page to a new specific page using
301s.
Can someone help me set up the first two redirects?
New site is Magento based, on a Linux server, using
Apache. I have ISAPI 3.0.
A couple examples of what I need to redirect:
Current URL:
http://www.mydomain.com/subfolder/
New URL:
http://www.mydomain.com/subfolder.html
Current URL:
http://www.mydomain.com/subfolder/products.asp?dept=135
New URL:
http://www.mydomain.com/subfolder/category.html
Current URL:
http://www.mydomain.com/subfolder/departments.asp?
dept=135
New URL:
http://www.mydomain.com/subfolder/category.html
Current URLs (terrible current site):
http://www.mydomain.com/subfolder1/prodinfo.asp?
number=PRODUCT1
http://www.mydomain.com/subfolder2/prodinfo.asp?
number=PRODUCT1
http://www.mydomain.com/subfolder3/prodinfo.asp?
number=PRODUCT1
New URL:
http://www.mydomain.com/subfolder1/PRODUCT1.html
I have no problem on my end creating the multiple entries
for all of the "sub folders", just a lot of copy and
pasting with minor modifications.
Can someone help me set up this first set of redirects so
that I can duplicate for all subsequent pages?
Also, is there a simple method for redirecting all calls
to URLs with uppercase characters to their all-lower-case
counterparts? The new site throws a 404 when you change a
single character to upper case.
Thanks in advance.
|
| Back to Top |
|
| |
Anton Admin Group

Joined: 30 January 2007 Location: Ukraine
Online Status: Offline Posts: 10520
|
| Posted: 09 June 2010 at 4:58am | IP Logged
|
|
|
Ok, so here are the rules:
RewriteBase /
#Current URL: http://www.mydomain.com/subfolder/
#New URL: http://www.mydomain.com/subfolder.html
RewriteRule ^([^/.]+)$ $1.html [R=301,L]
#Current URL: http://www.mydomain.com/subfolder/products.asp?dept=135
#New URL: http://www.mydomain.com/subfolder/category.html
RewriteCond %{QUERY_STRING} ^dept=135$ [NC]
RewriteRule ^([^/.]+)/products\.asp$ $1/category.html [R=301,L]
#Current URL: http://www.mydomain.com/subfolder/departments.asp?dept=135
#New URL: http://www.mydomain.com/subfolder/category.html
RewriteCond %{QUERY_STRING} ^dept=135$ [NC]
RewriteRule ^([^/.]+)/departments\.asp$ $1/category.html [R=301,L]
#http://www.mydomain.com/subfolder1/prodinfo.asp?number=PRODUCT1
#http://www.mydomain.com/subfolder2/prodinfo.asp?number=PRODUCT1
#http://www.mydomain.com/subfolder3/prodinfo.asp?number=PRODUCT1
#New URL: http://www.mydomain.com/subfolder1/PRODUCT1.html
RewriteCond %{QUERY_STRING} ^number=([^/.&]+)$ [NC]
RewriteRule ^(?:subfolder1|subfolder2|subfolder3)/prodinfo\.asp$ subfolder1/%1.html [R=301,L]
#a simple method for redirecting all calls to URLs with uppercase characters to their all-lower-case counterparts
RewriteCond %{REQUEST_URI} [A-Z] [OR]
RewriteCond %{QUERY_STRING} [A-Z]
RewriteRule .? %{REQUEST_URI}\?%{QUERY_STRING} [CL,R=301,L]
__________________ Regards,
Anton
|
| Back to Top |
|
| |
rory_a Newbie

Joined: 08 June 2010
Online Status: Offline Posts: 15
|
| Posted: 10 June 2010 at 6:21pm | IP Logged
|
|
|
Thanks Anton,
Working on it now. When I have a few examples I'll repost
my .htaccess if you wouldn't mind reviewing to make sure
I'm not going to blow up my new site
|
| Back to Top |
|
| |
rory_a Newbie

Joined: 08 June 2010
Online Status: Offline Posts: 15
|
| Posted: 10 June 2010 at 6:25pm | IP Logged
|
|
|
Just to make sure because I left a set of examples out:
My current site allows all subfolders to display a
department page like this (just like the products)
creating numerous instances of the same page and I need
to redirect them all to a single page:
http://www.mydomain.com/products.asp?dept=135
http://www.mydomain.com/subfolder1/products.asp?dept=135
http://www.mydomain.com/subfolder2/products.asp?dept=135
http://www.mydomain.com/subfolder3/products.asp?dept=135
http://www.mydomain.com/departments.asp?dept=135
http://www.mydomain.com/subfolder1/departments.asp?
dept=135
http://www.mydomain.com/subfolder2/departments.asp?
dept=135
http://www.mydomain.com/subfolder3/departments.asp?
dept=135
And the page needs to be redirected to:
http://www.mydomain.com/subfolder/department-name.html
Can I still use this only this RewriteRule:
RewriteCond %{QUERY_STRING} ^dept=135$ [NC]
RewriteRule ^([^/.]+)/departments\.asp$ $1/category.html
[R=301,L]
And, because the site truly is pure garbage, I'd need to
stack it like this, if possible:
RewriteCond %{QUERY_STRING} ^dept=135$ [NC]
RewriteRule ^([^/.]+)/departments\.asp$ $1/category.html
[R=301,L]
RewriteRule ^([^/.]+)/products\.asp$ $1/category.html
[R=301,L]
Or, would I need to provide a new RewriteCond and
RewriteRule for every instance?
Edited by rory_a - 10 June 2010 at 6:35pm
|
| Back to Top |
|
| |
Anton Admin Group

Joined: 30 January 2007 Location: Ukraine
Online Status: Offline Posts: 10520
|
| Posted: 11 June 2010 at 2:28am | IP Logged
|
|
|
I may suggest you the following:
create a mapfile.txt with the following content:
135 department-name
222 department-name2
etc.
And use the following config to handle all this:
RewriteBase /
RewriteMap mapfile txt:mapfile.txt [NC]
#Current URL: http://www.mydomain.com/subfolder/
#New URL: http://www.mydomain.com/subfolder.html
RewriteRule ^([^/.]+)$ $1.html [R=301,L]
#Current URL: http://www.mydomain.com/subfolder/products.asp?dept=135
#New URL: http://www.mydomain.com/subfolder/category.html
RewriteCond %{QUERY_STRING} ^dept=(\d+)$ [NC]
RewriteRule (?:products|departments)\.asp$ subfolder/${mapfile:%1}.html? [R=301,L]
#http://www.mydomain.com/subfolder1/prodinfo.asp?number=PRODUCT1
#http://www.mydomain.com/subfolder2/prodinfo.asp?number=PRODUCT1
#http://www.mydomain.com/subfolder3/prodinfo.asp?number=PRODUCT1
#New URL: http://www.mydomain.com/subfolder1/PRODUCT1.html
RewriteCond %{QUERY_STRING} ^number=([^/.&]+)$ [NC]
RewriteRule ^(?:subfolder1|subfolder2|subfolder3)/prodinfo\.asp$ subfolder/%1.html [R=301,L]
#a simple method for redirecting all calls to URLs with uppercase characters to their all-lower-case counterparts
RewriteCond %{REQUEST_URI} [A-Z] [OR]
RewriteCond %{QUERY_STRING} [A-Z]
RewriteRule .? %{REQUEST_URI}\?%{QUERY_STRING} [CL,R=301,L]
__________________ Regards,
Anton
|
| Back to Top |
|
| |
rory_a Newbie

Joined: 08 June 2010
Online Status: Offline Posts: 15
|
| Posted: 15 June 2010 at 2:02pm | IP Logged
|
|
|
Anton, Thanks again for your help here. What I've come up
with as a "working" start is:
MY MAPFILE.TXT TEXT:
79 snowboard-shop/snowboard-goggles
1158 snowboard-shop/snowboard-gloves-mitts
BSARMAIM 2009-arbor-makaha-mens-boardshorts-swim-trunks-
black-charcoal
(note that 79 and 1158 are department numbers, BSARMAIM
is a product number. please also note that I indicated
the complete URL path from root.)
MY .HTACCESS FILE IS:
# Helicon ISAPI_Rewrite configuration file
# Version 3.1.0.73
RewriteBase /
RewriteMap mapfile txt:mapfile.txt [NC]
RewriteRule ^([^/.]+)$ $1.html [R=301,L]
RewriteCond %{REQUEST_URI} [A-Z] [OR]
RewriteCond %{QUERY_STRING} [A-Z]
RewriteRule .? %{REQUEST_URI}\?%{QUERY_STRING}
[CL,R=301,L]
RewriteCond %{QUERY_STRING} ^dept=(\d+)$ [NC]
RewriteRule (?:products|departments)\.asp$
${mapfile:%1}.html? [R=301,L]
RewriteCond %{QUERY_STRING} ^prodinfo=(\d+)$ [NC]
RewriteRule (?:||snowboard-shop|skateboard-
shop|clothing|women|clearance-sale|brands)/prodinfo\.asp$
${mapfile:%1}.html? [R=301,L]
(note that I added "||" to indicate root, no subfolder
URLs - is this correct and/or necessary?)
Does this look correct?
Thank you very much for your help. This seems to be quite
a headache with a site as garbled as mine.
Rory
Edited by rory_a - 15 June 2010 at 2:03pm
|
| Back to Top |
|
| |
Anton Admin Group

Joined: 30 January 2007 Location: Ukraine
Online Status: Offline Posts: 10520
|
| Posted: 16 June 2010 at 4:43am | IP Logged
|
|
|
I've made just a small fix, and everything else is looking absolutely fine:
RewriteBase /
RewriteMap mapfile txt:mapfile.txt [NC]
RewriteRule ^([^/.]+)$ $1.html [R=301,L]
RewriteCond %{REQUEST_URI} [A-Z] [OR]
RewriteCond %{QUERY_STRING} [A-Z]
RewriteRule .? %{REQUEST_URI}\?%{QUERY_STRING} [CL,R=301,L]
RewriteCond %{QUERY_STRING} ^dept=(\d+)$ [NC]
RewriteRule (?:products|departments)\.asp$ ${mapfile:%1}.html? [R=301,L]
RewriteCond %{QUERY_STRING} ^prodinfo=([^&]+)$ [NC]
RewriteRule ^(?:snowboard-shop|skateboard-shop|clothing|women|clearance-sale|brands)/prodinfo\.asp$ ${mapfile:%1}.html? [R=301,L]
__________________ Regards,
Anton
|
| Back to Top |
|
| |
rory_a Newbie

Joined: 08 June 2010
Online Status: Offline Posts: 15
|
| Posted: 16 June 2010 at 6:11pm | IP Logged
|
|
|
It looks like you've simply changed:
RewriteRule (?:||snowboard-shop|skateboard-
shop|clothing|women|clearance-sale|brands)/prodinfo\.asp$
${mapfile:%1}.html? [R=301,L]
To:
RewriteRule (?:snowboard-shop|skateboard-
shop|clothing|women|clearance-sale|brands)/prodinfo\.asp$
${mapfile:%1}.html? [R=301,L]
I just wanted to make sure that this will work,
considering that you can currently access the pages to be
redirected from the root level, without a subfolder -
this is the reason I included the "||" section - to
indicate the root level.
Thanks for all of your help Anton, it's truly been a time
saver as well as making sure that the new site doesn't
fall flat on its face at launch.
Rory
|
| Back to Top |
|
| |
rory_a Newbie

Joined: 08 June 2010
Online Status: Offline Posts: 15
|
| Posted: 23 June 2010 at 11:41am | IP Logged
|
|
|
I've just finished creating my .httaccess and mapfile
files, uploaded them, and crashed the site.
Am I missing anything? What information can I provide in
order to explain my system to understand what my issue
might be?
|
| Back to Top |
|
| |
Anton Admin Group

Joined: 30 January 2007 Location: Ukraine
Online Status: Offline Posts: 10520
|
| Posted: 24 June 2010 at 3:21am | IP Logged
|
|
|
Can you please show both .htaccess and mapfiles, the testing request, the result you get and the result you expect to get.
Also provide IIS and rewrite logs records for that request.
__________________ Regards,
Anton
|
| Back to Top |
|
| |
rory_a Newbie

Joined: 08 June 2010
Online Status: Offline Posts: 15
|
| Posted: 25 June 2010 at 11:20am | IP Logged
|
|
|
At this time all I can provide is the .htaccess and map
files, which are above (the mapfile is considerably longer
now).
How may I obtain the other information requested?
Also, just to make sure I have everything correctly set-up,
I installed the ISAPI software on my PC, created the file,
added the code in that file to the site's existing
.htaccess file, uploaded it and the mapfile to the web
server. Is this the correct process?
|
| Back to Top |
|
| |
Anton Admin Group

Joined: 30 January 2007 Location: Ukraine
Online Status: Offline Posts: 10520
|
| Posted: 29 June 2010 at 9:53am | IP Logged
|
|
|
"I installed the ISAPI software on my PC, created the file, added the code in that file to the site's existing .htaccess file, uploaded it and
the mapfile to the web server. Is this the correct process?"
- yes, that seems to be correct. Just to clarify, do you have the mapfile in the same folder with .htaccess?
"How may I obtain the other information requested? "
- Please tell what testing request you make, what is the result of this request and what is the result you expect (if they don't match).
to get rewrite.log records, please enable logging in httpd.conf like this:
RewriteLogLevel 9
Rewrite.log file will be created in ISAPI_Rewrite installation folder.
__________________ Regards,
Anton
|
| Back to Top |
|
| |
rory_a Newbie

Joined: 08 June 2010
Online Status: Offline Posts: 15
|
| Posted: 29 June 2010 at 10:21am | IP Logged
|
|
|
I'll look into providing the requested info.
I do have this error from my server's error log that is
likely a related issue:
[Wed Jun 23 09:25:41 2010] [alert] [client 216.82.147.45]
/home/eterna15/public_html/.htaccess: RewriteMap not
allowed here, referer:
http://advanced332.inmotionhosting.com/~eterna15/index.ph
p
[Wed Jun 23 09:25:41 2010] [alert] [client 216.82.147.45]
/home/eterna15/public_html/.htaccess: RewriteMap not
allowed here
|
| Back to Top |
|
| |
rory_a Newbie

Joined: 08 June 2010
Online Status: Offline Posts: 15
|
| Posted: 29 June 2010 at 6:53pm | IP Logged
|
|
|
"yes, that seems to be correct. Just to clarify, do you
have the mapfile in the same folder with .htaccess? "
I do have the .htaccess file and mapfile.txt in the same
folder on my server.
I added the above rewrite rules into the standard
.htaccess file. When I upload this file to the site it
404's every page. It breaks the links as it loads pages
using URLs without /index.php/ in them, which breaks the
pages.
I'm also trying to get the developers to identify why the
pages break without the /index.php/ in the URL as it
shouldn't be there.
Either way, I'm breaking the site, and not seeing how to
display or generate any error messages.
|
| Back to Top |
|
| |
rory_a Newbie

Joined: 08 June 2010
Online Status: Offline Posts: 15
|
| Posted: 29 June 2010 at 6:57pm | IP Logged
|
|
|
When I try to save the entire .htaccess file in ISAPI, I
get the following errors:
Unknown expression on line #27: DirectoryIndex index.php
Unknown expression on line #116: Options +FollowSymLinks
Unknown expression on line #192: AddDefaultCharset Off
Unknown expression on line #208: Order allow,deny
Unknown expression on line #209: Allow from all
These errors correspond to these lines:
Line 27:
DirectoryIndex index.php
Line 116:
Options +FollowSymLinks
Line 192:
AddDefaultCharset Off
Line 208:
Order allow,deny
Line 209:
Allow from all
|
| Back to Top |
|
| |
rory_a Newbie

Joined: 08 June 2010
Online Status: Offline Posts: 15
|
| Posted: 29 June 2010 at 9:33pm | IP Logged
|
|
|
Here's the rewrite.log file contents:
::1 ::1 Tue, 29-Jun-2010 15:35:21 GMT
[localhost/sid#1][rid#31713384/initial] (2) init rewrite
engine with requested uri /CFIDE/main/ide.cfm?
CFSRV=IDE&ACTION=IDE_DEFAULT
::1 ::1 Tue, 29-Jun-2010 15:35:21 GMT
[localhost/sid#1][rid#31713384/initial] (1) Htaccess
process request C:\Program
Files\Helicon\ISAPI_Rewrite3\httpd.conf
::1 ::1 Tue, 29-Jun-2010 15:35:22 GMT
[localhost/sid#1][rid#31713384/initial] (1) Htaccess
process request c:\inetpub\wwwroot\.htaccess
::1 ::1 Tue, 29-Jun-2010 15:35:22 GMT
[localhost/sid#1][rid#31713384/initial] (3) applying
pattern '^([^/.]+)$' to uri 'CFIDE/main/ide.cfm'
::1 ::1 Tue, 29-Jun-2010 15:35:22 GMT
[localhost/sid#1][rid#31713384/initial] (3) applying
pattern '.?' to uri 'CFIDE/main/ide.cfm'
::1 ::1 Tue, 29-Jun-2010 15:35:22 GMT
[localhost/sid#1][rid#31713384/initial] (4) RewriteCond:
input='/CFIDE/main/ide.cfm' pattern='[A-Z]' => matched
::1 ::1 Tue, 29-Jun-2010 15:35:22 GMT
[localhost/sid#1][rid#31713384/initial] (1) escaping
/cfide/main/ide.cfm?cfsrv=ide&action=ide_default
::1 ::1 Tue, 29-Jun-2010 15:35:22 GMT
[localhost/sid#1][rid#31713384/initial] (2) explicitly
forcing redirect with
http://localhost/cfide/main/ide.cfm?
cfsrv=ide&action=ide_default
::1 ::1 Tue, 29-Jun-2010 15:35:22 GMT
[localhost/sid#1][rid#31713384/initial] (2) internal
redirect with /CFIDE/main/ide.cfm?
CFSRV=IDE&ACTION=IDE_DEFAULT [INTERNAL REDIRECT]
::1 ::1 Tue, 29-Jun-2010 15:35:22 GMT
[localhost/sid#1][rid#31713384/initial] (2) init rewrite
engine with requested uri /cfide/main/ide.cfm?
cfsrv=ide&action=ide_default
::1 ::1 Tue, 29-Jun-2010 15:35:22 GMT
[localhost/sid#1][rid#31713384/initial] (1) Htaccess
process request C:\Program
Files\Helicon\ISAPI_Rewrite3\httpd.conf
::1 ::1 Tue, 29-Jun-2010 15:35:22 GMT
[localhost/sid#1][rid#31713384/initial] (1) Htaccess
process request c:\inetpub\wwwroot\.htaccess
::1 ::1 Tue, 29-Jun-2010 15:35:22 GMT
[localhost/sid#1][rid#31713384/initial] (3) applying
pattern '^([^/.]+)$' to uri 'cfide/main/ide.cfm'
::1 ::1 Tue, 29-Jun-2010 15:35:22 GMT
[localhost/sid#1][rid#31713384/initial] (3) applying
pattern '.?' to uri 'cfide/main/ide.cfm'
::1 ::1 Tue, 29-Jun-2010 15:35:22 GMT
[localhost/sid#1][rid#31713384/initial] (4) RewriteCond:
input='/cfide/main/ide.cfm' pattern='[A-Z]' => not-
matched
::1 ::1 Tue, 29-Jun-2010 15:35:22 GMT
[localhost/sid#1][rid#31713384/initial] (4) RewriteCond:
input='cfsrv=ide&action=ide_default' pattern='[A-Z]' =>
not-matched
::1 ::1 Tue, 29-Jun-2010 15:35:22 GMT
[localhost/sid#1][rid#31713384/initial] (3) applying
pattern '(?:products|departments)\.asp$' to uri
'cfide/main/ide.cfm'
::1 ::1 Tue, 29-Jun-2010 15:35:22 GMT
[localhost/sid#1][rid#31713384/initial] (3) applying
pattern '(?:||snowboard-shop|skateboard-
shop|clothing|women|clearance-
sale|brands)/prodinfo\.asp$' to uri 'cfide/main/ide.cfm'
|
| Back to Top |
|
| |
Anton Admin Group

Joined: 30 January 2007 Location: Ukraine
Online Status: Offline Posts: 10520
|
| Posted: 30 June 2010 at 4:52am | IP Logged
|
|
|
Regarding unknown expressions: I haven't provided you with such directives and I guess you've taken them from some Apache config, but the are
unsupported in ISAPI_Rewrite, 'cause the are not a part of mod_rewrite module.
Strange thing: we don't have such log records in ISAPI_Rewrite logs
[Wed Jun 23 09:25:41 2010] [alert] [client 216.82.147.45]
/home/eterna15/public_html/.htaccess: RewriteMap not allowed here
Are you using Apache on Windows?
Please clarify. And show the complete config you use.
__________________ Regards,
Anton
|
| Back to Top |
|
| |
rory_a Newbie

Joined: 08 June 2010
Online Status: Offline Posts: 15
|
| Posted: 30 June 2010 at 8:21am | IP Logged
|
|
|
The unknown expressions errors were generated when I
checked the entire .htaccess file below in the ISAPI
software. Those expressions are a part of the site's
software's default .htaccess file which I'm appending
too. When I run this file unmodified, the site is ok.
When I add the ISAPI code, it 404s everything. When I
run only the ISAPI code, it also 404s everything.
Here is the entire .htaccess file, as provided by the
site's software programmers, with the additional ISAPI
code inserted near the bottom:
############################################
## uncomment these lines for CGI mode
## make sure to specify the correct cgi php binary file
name
## it might be /cgi-bin/php-cgi
# Action php5-cgi /cgi-bin/php5-cgi
# AddHandler php5-cgi .php
############################################
## GoDaddy specific options
# Options -MultiViews
## you might also need to add this line to php.ini
## cgi.fix_pathinfo = 1
## if it still doesn't work, rename php.ini to php5.ini
############################################
## this line is specific for 1and1 hosting
#AddType x-mapp-php5 .php
#AddHandler x-mapp-php5 .php
############################################
## default index file
DirectoryIndex index.php
<IfModule mod_php5.c>
############################################
## adjust memory limit
# php_value memory_limit 64M
php_value memory_limit 128M
php_value max_execution_time 18000
############################################
## disable magic quotes for php request vars
php_flag magic_quotes_gpc off
############################################
## disable automatic session start
## before autoload was initialized
php_flag session.auto_start off
############################################
## enable resulting html compression
#php_flag zlib.output_compression on
###########################################
# disable user agent verification to not break multiple
image upload
php_flag suhosin.session.cryptua off
###########################################
# turn off compatibility with PHP4 when dealing with
objects
php_flag zend.ze1_compatibility_mode Off
</IfModule>
<IfModule mod_security.c>
###########################################
# disable POST processing to not break multiple image
upload
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>
<IfModule mod_deflate.c>
############################################
## enable apache served files compression
## http://developer.yahoo.com/performance/rules.html#gzip
# Insert filter on all content
###SetOutputFilter DEFLATE
# Insert filter on selected content types only
#AddOutputFilterByType DEFLATE text/html text/plain
text/xml text/css text/javascript
# Netscape 4.x has some problems...
#BrowserMatch ^Mozilla/4 gzip-only-text/html
# Netscape 4.06-4.08 have some more problems
#BrowserMatch ^Mozilla/4\.0[678] no-gzip
# MSIE masquerades as Netscape, but it is fine
#BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
# Don't compress images
#SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-
gzip dont-vary
# Make sure proxies don't deliver the wrong content
#Header append Vary User-Agent env=!dont-vary
</IfModule>
<IfModule mod_ssl.c>
############################################
## make HTTPS env vars available for CGI mode
SSLOptions StdEnvVars
</IfModule>
<IfModule mod_rewrite.c>
############################################
## enable rewrites
Options +FollowSymLinks
RewriteEngine on
############################################
## you can put here your magento root folder
## path relative to web root
#RewriteBase /magento/
############################################
## workaround for HTTP authorization
## in CGI environment
RewriteRule .* -
[E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
############################################
## always send 404 on missing files in these folders
RewriteCond %{REQUEST_URI} !^/(media|skin|js)/
############################################
## never rewrite for existing files, directories and
links
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
############################################
## rewrite everything else to index.php
RewriteRule .* index.php [L]
############################################
## Begin ISAPI ReWrites
## Helicon ISAPI_Rewrite configuration file
## Version 3.1.0.73
RewriteBase /
RewriteMap mapfile txt:mapfile.txt [NC]
RewriteRule ^([^/.]+)$ $1.html [R=301,L]
RewriteCond %{REQUEST_URI} [A-Z] [OR]
RewriteCond %{QUERY_STRING} [A-Z]
RewriteRule .? %{REQUEST_URI}\?%{QUERY_STRING}
[CL,R=301,L]
RewriteCond %{QUERY_STRING} ^dept=(\d+)$ [NC]
RewriteRule (?:products|departments)\.asp$
${mapfile:%1}.html? [R=301,L]
RewriteCond %{QUERY_STRING} ^prodinfo=(\d+)$ [NC]
RewriteRule (?:||snowboard-shop|skateboard-
shop|clothing|women|clearance-sale|brands)/prodinfo\.asp$
${mapfile:%1}.html? [R=301,L]
</IfModule>
############################################
## Prevent character encoding issues from server
overrides
## If you still have problems, use the second line
instead
AddDefaultCharset Off
#AddDefaultCharset UTF-8
<IfModule mod_expires.c>
############################################
## Add default Expires header
##
http://developer.yahoo.com/performance/rules.html#expires
ExpiresDefault "access plus 1 year"
</IfModule>
############################################
## By default allow all access
Order allow,deny
Allow from all
############################################
## If running in cluster environment, uncomment this
##
http://developer.yahoo.com/performance/rules.html#etags
#FileETag none
The error log:
[Wed Jun 23 09:25:41 2010] [alert] [client 216.82.147.45]
/home/eterna15/public_html/.htaccess: RewriteMap not
allowed here
is from my web server's error log, not the ISAPI/Helicon
reports.log file.
The ISAPI code was uploaded from my Windows Vista PC to
my Linux x86_64 server which has Apache 2.2.15.
This is probably another stupid question, but the logs
referenced the httpd.conf file - which I cannot locate
either in the Helicon/ISAPI files, or on the web server.
Am I missing this file, causing the errors?
|
| Back to Top |
|
| |
rory_a Newbie

Joined: 08 June 2010
Online Status: Offline Posts: 15
|
| Posted: 30 June 2010 at 10:27am | IP Logged
|
|
|
I have a fairly quick and dumb question, but could the root
of my problems getting this rewrite file to work be that my
current development URL is
http://advanced332.inmotionhosting.com/~eterna15/ ?
I just got to thinking the "~" in the URL might be causing
this issue.
|
| Back to Top |
|
| |
Anton Admin Group

Joined: 30 January 2007 Location: Ukraine
Online Status: Offline Posts: 10520
|
| Posted: 01 July 2010 at 5:47am | IP Logged
|
|
|
"I just got to thinking the "~" in the URL might be causing this issue."
- that's hardly possible. ~ character is valid for URLs.
- Could you please indicate the path to the log saying:
[Wed Jun 23 09:25:41 2010] [alert] [client 216.82.147.45]
/home/eterna15/public_html/.htaccess: RewriteMap not allowed here
"The ISAPI code was uploaded from my Windows Vista PC to my Linux x86_64 server which has Apache 2.2.15. "
- so are you trying to make the code working on Apache?
__________________ Regards,
Anton
|
| Back to Top |
|
| |